Add HTTP codes 307 and 308 for redirect

See https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
This commit is contained in:
Joxit 2018-07-12 10:10:23 +02:00
parent 137da9b903
commit e1bc24ce97
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;