eventsource icon indicating copy to clipboard operation
eventsource copied to clipboard

Relative redirects do not work

Open BrennanConroy opened this issue 3 years ago • 2 comments

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 avatar May 25 '22 22:05 BrennanConroy

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.

rexxars avatar May 26 '22 19:05 rexxars

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

BrennanConroy avatar May 26 '22 21:05 BrennanConroy