({
statusCode,
method,
followRedirect,
followAllRedirects,
})
| 12 | } |
| 13 | |
| 14 | function shouldFollowRedirect({ |
| 15 | statusCode, |
| 16 | method, |
| 17 | followRedirect, |
| 18 | followAllRedirects, |
| 19 | }) { |
| 20 | if (!followRedirect || !REDIRECT_STATUS_CODES.has(statusCode)) return false; |
| 21 | if (statusCode === 303) return true; |
| 22 | if (followAllRedirects) return true; |
| 23 | |
| 24 | const normalizedMethod = normalizeMethod(method); |
| 25 | return normalizedMethod === "GET" || normalizedMethod === "HEAD"; |
| 26 | } |
| 27 | |
| 28 | function shouldRewriteMethodForRedirect(statusCode, method) { |
| 29 | const normalizedMethod = normalizeMethod(method); |
no test coverage detected