-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
header.location in Redirects is Double-Encoded in Nuxt v3.12.1 #27554
Comments
cc: @huang-julien |
Do you have a minimal reproduction please ? At first, it looks like this is due to the revert we made in nuxt 3.12. Nuxt encode the location header when redirecting in SSR |
Would you be able to provide a reproduction? 🙏 More infoWhy do I need to provide a reproduction?Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. What will happen?If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect. If How can I create a reproduction?We have a couple of templates for starting with a minimal reproduction: 👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as minimal as possible. See more details in our guide. You might also find these other articles interesting and/or helpful: |
@huang-julien |
I had the same issue. Here is a minimal reproduction. path should be |
Facing same issue. Works fine with |
From discussion, it seems that this is rather |
I am also encountering this issue after upgrading from I suggest this change to be reverted, as this is a breaking change in the |
Echoing the impact of this bug: Redirections to external urls are currently broken, if they include parameters that are already encoded. This is common when dealing with authentication redirects. Also, this seems like a big blind spot in test coverage. |
Environment
Reproduction
Describe the bug
In the latest version of Nuxt, it appears that the header.location in the redirects is being encoded using encodeURI. This causes issues when the redirection URL contains another URL as a query parameter. The nested URL gets encoded multiple times, resulting in a failed redirection.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: