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

Function removeParam

pkg/utils.go:242–260  ·  view source on GitHub ↗
(rawURL string, paramToRemove string)

Source from the content-addressed store, hash-verified

240}
241
242func removeParam(rawURL string, paramToRemove string) (string, string, error) {
243 // Parse the URL
244 parsedURL, err := url.Parse(rawURL)
245 if err != nil {
246 return "", "", err
247 }
248
249 // Get current query parameters
250 query := parsedURL.Query()
251 ogValue := query.Get(paramToRemove)
252
253 // Check if the parameter exists and remove it
254 if _, exists := query[paramToRemove]; exists {
255 query.Del(paramToRemove)
256 parsedURL.RawQuery = query.Encode()
257 }
258
259 return parsedURL.String(), ogValue, nil
260}
261
262/* Create a random long integer */
263func randInt() string {

Callers 3

ScanParametersFunction · 0.85
ScanParameterPollutionFunction · 0.85
ScanParameterEncodingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected