Merge branch 'redirect' of Joxit/urequest.js into master

This commit is contained in:
AJ ONeal 2018-07-12 09:01:02 +00:00 committed by Gitea
commit c4ec14fb6a
1 changed files with 1 additions and 1 deletions

View File

@ -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;