Skip to content

[Upload] Return 400 when a direct upload field is malformed - #4365

Open
Kocal wants to merge 1 commit into
symfony:3.xfrom
Kocal:upload/direct-malformed-field-bad-request
Open

Kocal wants to merge 1 commit into
symfony:3.xfrom
Kocal:upload/direct-malformed-field-bad-request

Conversation

@Kocal

@Kocal Kocal commented Nov 26, 2026

Copy link
Copy Markdown
Member
Q A
Bug fix? yes
New feature? no
Deprecations? no
Documentation? no
Issues
License MIT

direct() reads some multipart fields as strings. When a field is sent as an array (for example filename[]=x), the request bag throws a BadRequestException, which ended in the generic handler: a 500 response and an error log entry.

direct() now catches RequestExceptionInterface and returns a 400, as init() already does.

| Q              | A
| -------------- | ---
| Bug fix?       | yes
| New feature?   | no
| Deprecations?  | no
| Documentation? | no
| Issues         |
| License        | MIT

`direct()` reads some multipart fields as strings. When a field is sent as an array (for example `filename[]=x`), the request bag throws a `BadRequestException`, which ended in the generic handler: a 500 response and an error log entry.

`direct()` now catches `RequestExceptionInterface` and returns a 400, as `init()` already does.
@carsonbot carsonbot added Bug Bug Fix Upload Status: Needs Review Needs to be reviewed labels Nov 26, 2026
@Kocal
Kocal requested a review from smnandre November 26, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug Fix Status: Needs Review Needs to be reviewed Upload

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants