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

Function addCachebusterParameter

pkg/utils.go:206–225  ·  view source on GitHub ↗
(strUrl string, cbvalue string, cb string, prepend bool)

Source from the content-addressed store, hash-verified

204}
205
206func addCachebusterParameter(strUrl string, cbvalue string, cb string, prepend bool) (string, string) {
207 if cbvalue == "" {
208 cbvalue = "cb" + randInt()
209 }
210 if cb == "" {
211 cb = Config.Website.Cache.CBName
212 }
213 if !strings.Contains(strUrl, "?") {
214 strUrl += "?" + cb + "=" + cbvalue
215 } else {
216 if prepend {
217 parts := strings.SplitN(strUrl, "?", 2)
218 strUrl = parts[0] + "?" + cb + "=" + cbvalue + Config.QuerySeparator + parts[1]
219 } else {
220 strUrl += Config.QuerySeparator + cb + "=" + cbvalue
221 }
222 }
223
224 return strUrl, cbvalue
225}
226
227// RandomString generates a random string of the specified length
228func RandomString(length int) string {

Callers 4

setRequestFunction · 0.85
cachebusterParameterFunction · 0.85
ScanHTTPRequestSmugglingFunction · 0.85
ScanCSSFunction · 0.85

Calls 1

randIntFunction · 0.85

Tested by

no test coverage detected