diff --git a/server/public/public_endpoints.go b/server/public/public_endpoints.go index 46f2dc40..978d6108 100644 --- a/server/public/public_endpoints.go +++ b/server/public/public_endpoints.go @@ -32,7 +32,7 @@ func (p *Router) routes() http.Handler { r.Group(func(r chi.Router) { r.Use(server.URLParamsMiddleware) - r.Get("/img/{id}", p.handleImages) + r.HandleFunc("/img/{id}", p.handleImages) }) return r } diff --git a/server/subsonic/stream.go b/server/subsonic/stream.go index 25910716..1cb5a240 100644 --- a/server/subsonic/stream.go +++ b/server/subsonic/stream.go @@ -34,7 +34,7 @@ func (api *Router) serveStream(ctx context.Context, w http.ResponseWriter, r *ht w.Header().Set("Content-Length", length) } - if r.Method == "HEAD" { + if r.Method == http.MethodHead { go func() { _, _ = io.Copy(io.Discard, stream) }() } else { c, err := io.Copy(w, stream)