MCPcopy Create free account
hub / github.com/devploit/nomore403 / captureBodySignature

Function captureBodySignature

cmd/api.go:460–480  ·  view source on GitHub ↗
(r io.Reader)

Source from the content-addressed store, hash-verified

458}
459
460func captureBodySignature(r io.Reader) (int, string, error) {
461 hasher := fnv.New64a()
462 buf := make([]byte, 4096)
463 total := 0
464
465 for {
466 n, err := r.Read(buf)
467 if n > 0 {
468 total += n
469 _, _ = hasher.Write(buf[:n])
470 }
471 if err == io.EOF {
472 break
473 }
474 if err != nil {
475 return total, "", err
476 }
477 }
478
479 return total, fmt.Sprintf("%x", hasher.Sum64()), nil
480}
481
482func rawRequest(method, uri string, requestTarget string, headers []header, body string, timeout int) (ResponseInfo, error) {
483 parsedURL, err := url.Parse(uri)

Callers 2

requestBodyFunction · 0.85
rawRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected