chore: upgrade golangci-lint to 2.11 and fix lint issues
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -247,7 +247,7 @@ func uploadPlaylistImage(pls playlists.Playlists) http.HandlerFunc {
|
||||
p := req.Params(r)
|
||||
playlistId, _ := p.String(":id")
|
||||
|
||||
if err := r.ParseMultipartForm(maxImageSize); err != nil {
|
||||
if err := r.ParseMultipartForm(maxImageSize); err != nil { //nolint:gosec // size is limited by maxImageSize parameter
|
||||
log.Error(ctx, "Error parsing multipart form", err)
|
||||
http.Error(w, "file too large or invalid form", http.StatusBadRequest)
|
||||
return
|
||||
|
||||
@@ -31,9 +31,11 @@ import (
|
||||
|
||||
func postFormToQueryParams(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
r.Body = http.MaxBytesReader(w, r.Body, 10<<20) // 10MB
|
||||
err := r.ParseForm()
|
||||
if err != nil {
|
||||
sendError(w, r, newError(responses.ErrorGeneric, err.Error()))
|
||||
return
|
||||
}
|
||||
var parts []string
|
||||
for key, values := range r.Form {
|
||||
|
||||
Reference in New Issue
Block a user