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

Relative redirects do not work #277

Open
BrennanConroy opened this issue May 25, 2022 · 2 comments
Open

Relative redirects do not work #277

BrennanConroy opened this issue May 25, 2022 · 2 comments

Comments

@BrennanConroy
Copy link

BrennanConroy commented May 25, 2022

https://github.com/EventSource/eventsource/pull/273/files#diff-0768641ba3de29bd47afffe8f6fe71ed13e9fe1628a550ca18896269002b510eR164 changed to use new URL(location) which fails when the location header is a relative path: https://nodejs.org/api/url.html#new-urlinput-base

Edit: been dealing with 1.1.1 vs. 2.0.2 questions a lot, so got mixed up when writing the title

@BrennanConroy BrennanConroy changed the title Relative redirect URLs broken in 1.1.1 Relative redirect URLs broken in 2.0.2 May 26, 2022
@rexxars rexxars changed the title Relative redirect URLs broken in 2.0.2 Relative redirects do not work May 26, 2022
@rexxars
Copy link
Member

rexxars commented May 26, 2022

I've reworded the issue to be more specific - this is not a regression per se, since relative imports have never actually worked. Previously it would blindly set the URL to the value of the location header, so it would attempt to connect to the URL /some/relative/path, for instance. That would obviously always fail, since it is not a valid URL.

I have a PR to address a number of issues related to the redirect handling, but it will be released as a major version bump when it gets merged.

@BrennanConroy
Copy link
Author

Well the regression is it now throws "Invalid URL" when it didn't throw before. But fair point.

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

No branches or pull requests

2 participants