Skip to content

**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Preserve client-error status for malformed upload bodies** #165

Description

@BigSimmo

P2 Badge Preserve client-error status for malformed upload bodies

For authenticated /api/upload requests with a non-form content type or malformed multipart body, request.formData() throws a TypeError before the existing Missing file field check runs. After this change, that non-PublicApiError flows into the default jsonError(error) path and is reported as a 500 Request failed. response, even though the caller sent an invalid upload request; this regresses the upload validation contract and can pollute server-error monitoring. Wrap formData() parse failures as a 400 while keeping real storage/database failures as 5xx.

Useful? React with 👍 / 👎.

Originally posted by @chatgpt-codex-connector[bot] in #153 (comment)

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions