Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: actions wrong return 415 #11255

Merged

Conversation

alexbjorlig
Copy link
Contributor

per discussion 11248, this PR adds a fix so HTTP status code 415 "Unsupported Media Type" is returned (instead of 500).

The problem with returning 500 is that it's the wrong error message and not something that should be reported to for example Sentry.

fixes #11251

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

fixes sveltejs#11251

When posting to a form, with an unexpected content type like
application/json, the server returned 500. With this fix, it will return
415 error "Unsupported Media Type".
Copy link

changeset-bot bot commented Dec 10, 2023

🦋 Changeset detected

Latest commit: 8aca97c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dummdidumm dummdidumm merged commit 5faf68e into sveltejs:master Dec 12, 2023
11 of 13 checks passed
@github-actions github-actions bot mentioned this pull request Dec 12, 2023
@eltigerchino
Copy link
Member

Thank you!

dummdidumm pushed a commit that referenced this pull request Dec 13, 2023
We shouldn't have merged #11255 and #11278. They were reasonable changes on the face of it, but they were the wrong fix because it breaks apps for people that implement their own App.Error interface
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.

"Actions expect form-encoded data" error returns HTTP status code 500
3 participants