Merge branch 'redirect' of Joxit/urequest.js into master
This commit is contained in:
commit
c4ec14fb6a
2
index.js
2
index.js
|
@ -85,7 +85,7 @@ function setDefaults(defs) {
|
|||
resp.request.headers = finalOpts.headers;
|
||||
resp.request.toJSON = toJSONifier([ 'uri', 'method', 'headers' ]);
|
||||
|
||||
if (followRedirect && resp.headers.location && -1 !== [ 301, 302 ].indexOf(resp.statusCode)) {
|
||||
if (followRedirect && resp.headers.location && -1 !== [ 301, 302, 307, 308 ].indexOf(resp.statusCode)) {
|
||||
debug('Following redirect: ' + resp.headers.location);
|
||||
if ('GET' !== opts.method && !opts.followAllRedirects) {
|
||||
followRedirect = false;
|
||||
|
|
Loading…
Reference in New Issue