Skip to content

fix(backend): keep 4xx statuses from body-parser errors - #42

Open
veb wants to merge 1 commit into
masterfrom
fix/honour-4xx-statuses
Open

fix(backend): keep 4xx statuses from body-parser errors#42
veb wants to merge 1 commit into
masterfrom
fix/honour-4xx-statuses

Conversation

@veb

@veb veb commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

The catch-all maps every non-ClientError to 500, so malformed JSON and oversize bodies read as server faults: monitoring counts them against 5xx rates and webhook senders retry them forever. http-errors carries a numeric status; honour it when it is a 4xx.

Also brings over the regression test for the mid-body hangup crash the handler exists to prevent (a client aborting a POST mid-upload used to kill the process under Polka's default handler; this pins the custom handler against it). Note: the freia pin carries the same two changes on fix/abort-crash-freia-pin.

Tested: backend suite 483/483 on the pin branch; the new test file runs against the same handler code here.

The catch-all mapped every non-ClientError to 500, so malformed JSON and
oversize bodies read as server faults: monitoring counts them against
5xx rates and webhook senders retry them forever. http-errors carries a
numeric status; honour it when it is a 4xx.
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