-
-
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
HTTP 307 redirects break when normalizing URLs #9350
Comments
Honestly it sounds like we should just be using 307s in the first place — I don't recall why we originally chose 301 but it's very possible that there's no real reasoning behind it. The current behaviour is straightforwardly buggy. Or maybe 308s, since we want to transfer link juice. A permanent redirect carries the risk that the app developer will change Does that sound reasonable? |
* return 308s instead of 301s when normalising paths - fixes #9350 * remove only
Looks perfect, that fixes it! Thanks! |
Describe the bug
HTTP 307 description if you're not familiar with it
My use case is a bit complicated, but I need to redirect a POST request like this:
This works with SvelteKit, except when it normalizes paths:
This is due to this condition:
kit/packages/kit/src/runtime/server/respond.js
Lines 214 to 225 in 748e174
This should check if the original request is a 307, and use 307 too if that is the case.
Reproduction
Without normalization:
With normalization:
For example code see lxhom/sk-307-demo@f8d580e (the commit only includes the changed files from a base SK project)
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
I'd submit this as a PR (because this seems really easy), but I'm rather new to SK and I don't know if this would break other stuff.
The text was updated successfully, but these errors were encountered: