This repository has been archived by the owner on Jul 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
core/request : node provider only redirects URLs with protocol and host #278
Comments
sebilasse
changed the title
core/request : node provider only redirects absolute URLs
core/request : node provider only redirects URLs with protocol and host
Jan 25, 2017
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; |
rorticus
added a commit
to rorticus/core
that referenced
this issue
Feb 6, 2017
rorticus
added a commit
to rorticus/core
that referenced
this issue
Feb 6, 2017
Fix for this in #261 |
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. :) |
rorticus
added a commit
to rorticus/core
that referenced
this issue
Feb 9, 2017
rorticus
added a commit
to rorticus/core
that referenced
this issue
Feb 10, 2017
rorticus
added a commit
that referenced
this issue
Feb 10, 2017
* Updating request library to mimic fetch API, removing dependency on streams * Exporting correct interface file now * Request respones now using a queing event model * Removing arraybuffer/blob tests if the environment doesnt support them * Removing arrayBuffer test if blob isnt supported * Adding OPTIONS, HEAD convienence methods * Fixing import * Allowing for relative redirects in node provider, issue #278 * Rebasing onto latest * Handling gzip/deflate compression in node provider issue #259 * Rebasing on latest * Review feedback * Moving XHR responseType back
Fixed in #261 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
"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 to
https://stackoverflow.com/users{/userId}{/userName}
...same for
//stackoverflow.com/whatever
where it should keep the protocol ...The text was updated successfully, but these errors were encountered: