1
0
spogulis no https://github.com/therootcompany/request.js.git synced 2024-11-16 17:28:58 +00:00

Add HTTP codes 307 and 308 for redirect

See https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
Šī revīzija ir iekļauta:
Joxit 2018-07-12 10:10:23 +02:00
vecāks 137da9b903
revīzija e1bc24ce97

Parādīt failu

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