Closed DonMcNamara closed 4 years ago
I think this is a relatively easy fix. I think we just need to use the url constructor that takes a base argument: https://nodejs.org/api/url.html#url_constructor_new_url_input_base here: https://github.com/microsoft/typed-rest-client/blob/master/lib/HttpClient.ts#L279-L289
I can follow up with a PR soon, but if anyone beats me to it, I won't mind :wink:
Thanks for opening this @DonMcNamara ! We happily accept PRs :)
This issue has had no activity in 90 days. Please comment if it is not actually stale
I'm also running into this issue, will submit a PR. Anyone know of a workaround in the meantime?
Any updates on this? We ran into the same issue still
Environment
Node version: v12.14.1 Npm version: 6.13.4 OS and version: Ubuntu 18.04.1 typed-rest-client version: 1.7.2
Issue Description
Redirect URLs are being resolved incorrectly when the redirect location is a relative URL.
Expected behaviour
Redirect locations that are relative should be resolved using the URL of the current request as the base URL.
Actual behaviour
The URL is parsed as an absolute URL. This results in redirecting back to localhost.
Steps to reproduce
Logs
Relevant curl output: