MCPcopy Index your code
hub / github.com/chartbrew/chartbrew / shouldFollowRedirect

Function shouldFollowRedirect

server/modules/safeRequest.js:14–26  ·  view source on GitHub ↗
({
  statusCode,
  method,
  followRedirect,
  followAllRedirects,
})

Source from the content-addressed store, hash-verified

12}
13
14function 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
28function shouldRewriteMethodForRedirect(statusCode, method) {
29 const normalizedMethod = normalizeMethod(method);

Callers 1

safeRequestFunction · 0.85

Calls 1

normalizeMethodFunction · 0.85

Tested by

no test coverage detected