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

Function shouldRewriteMethodForRedirect

server/modules/safeRequest.js:28–38  ·  view source on GitHub ↗
(statusCode, method)

Source from the content-addressed store, hash-verified

26}
27
28function shouldRewriteMethodForRedirect(statusCode, method) {
29 const normalizedMethod = normalizeMethod(method);
30 if (normalizedMethod === "HEAD") return false;
31
32 if (statusCode === 303) return true;
33 if ((statusCode === 301 || statusCode === 302) && normalizedMethod === "POST") {
34 return true;
35 }
36
37 return false;
38}
39
40function normalizeHostname(hostname) {
41 return String(hostname || "")

Callers 1

safeRequestFunction · 0.85

Calls 1

normalizeMethodFunction · 0.85

Tested by

no test coverage detected