MCPcopy Index your code
hub / github.com/devploit/nomore403 / requestMethodOverrideHeaders

Function requestMethodOverrideHeaders

cmd/requester.go:2936–2976  ·  view source on GitHub ↗
(options RequestOptions)

Source from the content-addressed store, hash-verified

2934}
2935
2936func requestMethodOverrideHeaders(options RequestOptions) {
2937 overrideMethods := []string{"GET", "PUT", "PATCH", "DELETE", "OPTIONS"}
2938 overrideHeaders := []string{"X-HTTP-Method-Override", "X-HTTP-Method", "X-Method-Override"}
2939 total := len(overrideMethods) * len(overrideHeaders)
2940
2941 w := goccm.New(maxGoroutines)
2942 p := newProgress("method-override-header", total)
2943
2944 for _, headerName := range overrideHeaders {
2945 for _, overrideMethod := range overrideMethods {
2946 time.Sleep(time.Duration(delay) * time.Millisecond)
2947 w.Wait()
2948 go func(headerName, overrideMethod string) {
2949 defer w.Done()
2950 defer p.done()
2951
2952 headers := make([]header, len(options.headers))
2953 copy(headers, options.headers)
2954 headers = append(headers, header{headerName, overrideMethod})
2955
2956 resp, err := requestWithRetry("POST", options.uri, headers, options.proxy, options.rateLimit, options.timeout, options.redirect)
2957 if err != nil {
2958 if errors.Is(err, ErrRateLimited) {
2959 return
2960 }
2961 logVerbose(err)
2962 return
2963 }
2964 if isCalibrationMatch(resp.contentLength) {
2965 return
2966 }
2967
2968 result := resultFromResponse(headerName+": "+overrideMethod, false, "method-override-header", resp)
2969 attachHTTPReplay(&result, "POST", options.uri, headers, "", options.redirect, options.proxy, options.timeout)
2970 printResponse(result, "method-override-header")
2971 }(headerName, overrideMethod)
2972 }
2973 }
2974 w.WaitAllDone()
2975 p.finish()
2976}
2977
2978func requestMethodOverrideBody(options RequestOptions) {
2979 overrideMethods := []string{"PUT", "PATCH", "DELETE"}

Calls 9

newProgressFunction · 0.85
requestWithRetryFunction · 0.85
logVerboseFunction · 0.85
isCalibrationMatchFunction · 0.85
resultFromResponseFunction · 0.85
attachHTTPReplayFunction · 0.85
printResponseFunction · 0.85
doneMethod · 0.80
finishMethod · 0.80