Match kawa behavior on request matching
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
DataHoarder 2022-03-02 19:32:41 +01:00
parent 097aff358d
commit 0ae8a7e123

View file

@ -264,9 +264,8 @@ func (q *Queue) GetListeners() (listeners []*ListenerInformation) {
}
func (q *Queue) HandleRadioRequest(writer http.ResponseWriter, request *http.Request) {
mountName := strings.TrimPrefix(request.URL.Path, "/")
for _, mount := range q.mounts {
if mount.Mount == mountName {
if strings.HasSuffix(request.URL.Path, mount.Mount) {
writer.Header().Set("Server", "MeteorLight/radio")
writer.Header().Set("Content-Type", mount.MimeType)
writer.Header().Set("Accept-Ranges", "none")
@ -312,7 +311,7 @@ func (q *Queue) HandleRadioRequest(writer http.ResponseWriter, request *http.Req
mount.AddListener(&StreamListener{
Information: ListenerInformation{
Mount: mountName,
Mount: mount.Mount,
Path: uriPath,
Headers: headers,
},