Closed sebilasse closed 7 years ago
I am using
import * as URL from 'url';
/* ... */
const u = URL.parse(nativeResponse.headers.location);
const redirectUrl = (!u.host || !u.protocol) ?
URL.resolve(response.url, nativeResponse.headers.location) : nativeResponse.headers.location;
Fix for this in https://github.com/dojo/core/pull/261
@rorticus @dylans Thanks for fixing this. And (related to redirects) a feature request ;) : It could be useful to store the redirected URLs in an array in the options object. The options are returned as well and the user now knows the "URLs in beetween".
And (related to redirects) a feature request ;) : It could be useful to store the redirected URLs in an array in the options object. The options are returned as well and the user now knows the "URLs in beetween".
Please open a new issue for this and we'll consider how to address it, otherwise it will get lost in the noise of this issue. :)
Fixed in #261
"redirects" : from looking at the code it seems that the node provider does not resolve the
nativeResponse.headers.location
against the baseUrl.seen in the wild : If you come from
https://stackoverflow.com/users{/userId}
you are redirected to/users{/userId}{/userName}
and that SHOULD resolve tohttps://stackoverflow.com/users{/userId}{/userName}
...same for
//stackoverflow.com/whatever
where it should keep the protocol ...