Skip to content

Don't report benign multipart parse errors in request log middleware#94

Open
bbliem wants to merge 1 commit into
mainfrom
fix/request-log-multipart-parse-errors
Open

Don't report benign multipart parse errors in request log middleware#94
bbliem wants to merge 1 commit into
mainfrom
fix/request-log-multipart-parse-errors

Conversation

@bbliem

@bbliem bbliem commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Accessing request.FILES in the request-logging middleware forces Django to parse the multipart body. Malformed or oversized bodies (e.g. gzip'd Next.js server actions POSTed to /) raise MultiPartParserError/RequestDataTooBig/ TooManyFieldsSent, which were caught by the catch-all handler and reported to Sentry as application errors (WATCH-BACKEND-6V3).

Catch these client-triggered parse errors explicitly and skip logging without capturing them to Sentry.

Fixes WATCH-BACKEND-6V3

Accessing request.FILES in the request-logging middleware forces Django to
parse the multipart body. Malformed or oversized bodies (e.g. gzip'd Next.js
server actions POSTed to /) raise MultiPartParserError/RequestDataTooBig/
TooManyFieldsSent, which were caught by the catch-all handler and reported to
Sentry as application errors (WATCH-BACKEND-6V3).

Catch these client-triggered parse errors explicitly and skip logging without
capturing them to Sentry.

Fixes WATCH-BACKEND-6V3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant