Skip to content

🎧 Your Personal Streaming Service

Allow any HTTP methods for public images endpoint. Fix artist covers in Subtracks

Deluandfbf86c5779e
diff --git a/server/public/public_endpoints.go b/server/public/public_endpoints.go
index 46f2dc40a..978d61086 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 259107168..1cb5a240b 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)