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

This commit is contained in:
Deluan 2023-01-14 10:17:21 -05:00
parent 16c869ec86
commit dfbf86c577
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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)