diff --git a/backend/handlers/portfolio/images.go b/backend/handlers/portfolio/images.go index a1e8fe7..8fcd588 100644 --- a/backend/handlers/portfolio/images.go +++ b/backend/handlers/portfolio/images.go @@ -706,6 +706,7 @@ func UploadImage(w http.ResponseWriter, r *http.Request) { return } + // #nosec G120 — body size limited by limitBody middleware if err := r.ParseMultipartForm(10 << 20); err != nil { var maxBytesErr *http.MaxBytesError if errors.As(err, &maxBytesErr) { diff --git a/backend/handlers/portfolio/images_test.go b/backend/handlers/portfolio/images_test.go index cbfb670..57f35fd 100644 --- a/backend/handlers/portfolio/images_test.go +++ b/backend/handlers/portfolio/images_test.go @@ -34,17 +34,6 @@ import ( ) func makeRequest(handler http.HandlerFunc, method, path string, body interface{}, ctx context.Context) *httptest.ResponseRecorder { - var req *http.Request - if body != nil { - bodyBytes, _ := json.Marshal(body) - req = httptest.NewRequest(method, path, bytes.NewReader(bodyBytes)) - req = req.WithContext(ctx) - req.Header.Set("Content-Type", "application/json") - } else { - req = httptest.NewRequest(method, path, nil) - req = req.WithContext(ctx) - } - return makeRequestWithContext(handler, method, path, body, "", "", ctx) } diff --git a/backend/handlers/user/profile.go b/backend/handlers/user/profile.go index 23715cf..1a4344d 100644 --- a/backend/handlers/user/profile.go +++ b/backend/handlers/user/profile.go @@ -1002,6 +1002,7 @@ func UploadProfilePictureHandler(w http.ResponseWriter, r *http.Request) { return } + // #nosec G120 — body size limited by limitBody middleware if err := r.ParseMultipartForm(1 << 20); err != nil { var maxBytesErr *http.MaxBytesError if errors.As(err, &maxBytesErr) { diff --git a/backend/main.go b/backend/main.go index 1630b5d..7fbbc8a 100644 --- a/backend/main.go +++ b/backend/main.go @@ -69,8 +69,8 @@ func limitBody(limit int64) func(http.Handler) http.Handler { const ( defaultBodyLimit int64 = 1 * 1024 * 1024 // 1MB - uploadBodyLimit int64 = 15 * 1024 * 1024 // 15MB - portfolioBodyLimit int64 = 40 * 1024 * 1024 // 40MB (7 variants from 20MB source) + uploadBodyLimit int64 = 20 * 1024 * 1024 // 20MB + portfolioBodyLimit int64 = 30 * 1024 * 1024 // 30MB (7 variants) ) // nColor / bColor — Chi-style ANSI colors for request logging. diff --git a/frontend/src/lib/components/ui/map/MarkerContent.svelte b/frontend/src/lib/components/ui/map/MarkerContent.svelte index 8db07de..a5d0b43 100644 --- a/frontend/src/lib/components/ui/map/MarkerContent.svelte +++ b/frontend/src/lib/components/ui/map/MarkerContent.svelte @@ -22,8 +22,6 @@ // Move content to marker element when ready -// eslint-disable-next-line svelte/no-dom-manipulating - $effect(() => { const element = markerCtx.getElement(); const ready = markerCtx.isReady(); @@ -38,6 +36,7 @@ // Move content back on cleanup movedContent.forEach((child) => { if (wrapperElement && child.parentNode === element) { + // eslint-disable-next-line svelte/no-dom-manipulating wrapperElement.appendChild(child); } }); diff --git a/frontend/src/lib/components/ui/map/MarkerPopup.svelte b/frontend/src/lib/components/ui/map/MarkerPopup.svelte index 110ab7b..a8c91d8 100644 --- a/frontend/src/lib/components/ui/map/MarkerPopup.svelte +++ b/frontend/src/lib/components/ui/map/MarkerPopup.svelte @@ -43,8 +43,6 @@ // Create popup when marker is ready -// eslint-disable-next-line svelte/no-dom-manipulating - $effect(() => { const marker = markerCtx.getMarker(); const ready = markerCtx.isReady();