Skip to content

API: Respond with HTTP 400 to POST requests with no/multiple file#2130

Merged
kfranqueiro merged 1 commit into
typescriptfrom
kgf-ts-api-invalid-400
Jun 25, 2026
Merged

API: Respond with HTTP 400 to POST requests with no/multiple file#2130
kfranqueiro merged 1 commit into
typescriptfrom
kgf-ts-api-invalid-400

Conversation

@kfranqueiro

Copy link
Copy Markdown
Contributor

This updates logic in lib/api.ts to respond with an actual 400 status code rather than a 200 OK status with status: 400 in the response body, when the file parameter is missing or multiple values are passed.

(In 12.x, this currently responds with 200 OK containing status: 500 in the body, which is doubly incorrect, since this is a user input error, not a server error. I had already updated the 500 to 400 when initially converting to Typescript.)

@kfranqueiro kfranqueiro requested a review from deniak June 23, 2026 17:12
@kfranqueiro kfranqueiro merged commit 9bdd55f into typescript Jun 25, 2026
6 checks passed
@kfranqueiro kfranqueiro deleted the kgf-ts-api-invalid-400 branch June 25, 2026 19:08
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.

2 participants