MCPcopy Create free account
hub / github.com/Hackmanit/Web-Cache-Vulnerability-Scanner / setRequest

Function setRequest

pkg/utils.go:111–136  ·  view source on GitHub ↗
(req *fasthttp.Request, doPost bool, cb string, cookie map[string]string, prependCB bool)

Source from the content-addressed store, hash-verified

109}
110
111func setRequest(req *fasthttp.Request, doPost bool, cb string, cookie map[string]string, prependCB bool) {
112
113 cache := Config.Website.Cache
114 if cb != "" && cache.CBisParameter {
115 var newUrl string
116 newUrl, _ = addCachebusterParameter(req.URI().String(), cb, cache.CBName, prependCB)
117
118 newURL, err := url.Parse(newUrl)
119 if err != nil {
120 msg := "Converting " + newUrl + " to URL:" + err.Error() + "\n"
121 Print(msg, Red)
122 }
123 req.SetRequestURI(newURL.String())
124 req.UseHostHeader = true
125 }
126
127 setRequestHeaders(req, cb)
128 setRequestCookies(req, cb, cookie)
129
130 // Overwrite the content type if specified
131 if doPost {
132 if Config.ContentType != "" {
133 req.Header.SetContentType(Config.ContentType)
134 }
135 }
136}
137
138func responseCookiesToMap(resp *fasthttp.Response, cookieMap map[string]string) map[string]string {
139 resp.Header.VisitAllCookie(func(key, value []byte) {

Callers 8

checkIfAlwaysMissFunction · 0.85
cachebusterCookieFunction · 0.85
cachebusterHeaderFunction · 0.85
cachebusterParameterFunction · 0.85
cachebusterHTTPMethodFunction · 0.85
GetWebsiteFunction · 0.85
firstRequestFunction · 0.85

Calls 4

addCachebusterParameterFunction · 0.85
PrintFunction · 0.85
setRequestHeadersFunction · 0.85
setRequestCookiesFunction · 0.85

Tested by

no test coverage detected