-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Incorrect content-type parsing in actions #7187
Comments
https://www.rfc-editor.org/rfc/rfc7231#section-3.1.1.1 says the preferred type specification is: i.e. with no space |
I'll fix this. The easy solution would be to split on |
It would be nice to add tests |
Whatever we do here, we should probably also do for the content type check that's part of the CSRF protection, if appropriate. |
is this also related to #7112 ? i guess not right? |
Thanks for such a quick fix, great job. |
Describe the bug
When using a simple fetch to an endpoint like so:
This is sent by Chrome and Safari as a POST request with the following content-type header:
But https://github.com/sveltejs/kit/blob/master/packages/kit/src/runtime/server/page/actions.js checks the content-type value by splitting on
;
(note the space).Therefore I cannot use the above fetch call because the endpoint returns:
I think this is a bug and that you should instead split on
;
(without space).Reproduction
Use a simple fetch to an endpoint (/login/+page.server.js) like so:
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: