Discard request for image canceled by the client before any further processing
This commit is contained in:
@@ -53,6 +53,11 @@ func (api *Router) getPlaceHolderAvatar(w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
|
||||
func (api *Router) GetCoverArt(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error) {
|
||||
// If context is already canceled, discard request without further processing
|
||||
if r.Context().Err() != nil {
|
||||
return nil, nil //nolint:nilerr
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(r.Context(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user