From e1bc24ce97e5d15386be9227f3d3d12ab6dc9831 Mon Sep 17 00:00:00 2001 From: Joxit Date: Thu, 12 Jul 2018 10:10:23 +0200 Subject: [PATCH] Add HTTP codes 307 and 308 for redirect See https://en.wikipedia.org/wiki/List_of_HTTP_status_codes --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index fea4dc0..1fc76f0 100644 --- a/index.js +++ b/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;