-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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: action not found should return 404 #11278
fix: action not found should return 404 #11278
Conversation
When posting to a form action, that does exist, the server returned 500. With this fix, it will return 404 error "not found"
🦋 Changeset detectedLatest commit: 56a28f0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
I think you are correct - I was also a bit surprised that this was un-tested territory, but I'm all up for the task of adding more tests. In my work, we are currently in the process of being SOC 2 certified, and we use an application scanner that generates a bunch of frustrating 500 errors when it's running against Sveltekit. |
Should we be using kit/packages/kit/src/runtime/control.js Line 33 in 108a6a8
|
If we're being pedantic we can't really use @alexbjorlig when you're saying that Sentry shouldn't be flooded by this, do you mean that you don't want I'm inclined to merge this, but clean it up for 2.0 (or 3.0, depending on how urgent we see this). |
I have so many ideas for this discussion 🤔 Should we maybe move this to a dedicated discussion (instead of here on the PR)? |
I created #11287 for this, feel free to chime in! |
Actually that's not quite true, there are a couple of other places where we're calling |
When posting to a form action, that does not exist, the server returned 500(!)
With this fix, it will return 404 error "not found".
The problem with returning 500 is that it's the wrong error message and not something that should be reported to for example Sentry.
This is something I found, in relation to discussion 11248.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.