diff --git a/cmd/serve/dlna/dlna.go b/cmd/serve/dlna/dlna.go index 0c9d2fbca..fc802226c 100644 --- a/cmd/serve/dlna/dlna.go +++ b/cmd/serve/dlna/dlna.go @@ -186,7 +186,7 @@ func (s *server) rootDescHandler(w http.ResponseWriter, r *http.Request) { // Handle a service control HTTP request. func (s *server) serviceControlHandler(w http.ResponseWriter, r *http.Request) { soapActionString := r.Header.Get("SOAPACTION") - soapAction, err := parseActionHTTPHeader(soapActionString) + soapAction, err := upnp.ParseActionHTTPHeader(soapActionString) if err != nil { serveError(s, w, "Could not parse SOAPACTION header", err) return diff --git a/cmd/serve/dlna/dlna_test.go b/cmd/serve/dlna/dlna_test.go index acc1d0ffe..8327ee054 100644 --- a/cmd/serve/dlna/dlna_test.go +++ b/cmd/serve/dlna/dlna_test.go @@ -119,6 +119,8 @@ func TestContentDirectoryBrowseMetadata(t *testing.T) { assert.Equal(t, http.StatusOK, resp.StatusCode) body, err := ioutil.ReadAll(resp.Body) require.NoError(t, err) + // should contain an appropriate URN + require.Contains(t, string(body), "urn:schemas-upnp-org:service:ContentDirectory:1") // expect a element require.Contains(t, string(body), html.EscapeString("