(r io.Reader)
| 458 | } |
| 459 | |
| 460 | func 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 | |
| 482 | func rawRequest(method, uri string, requestTarget string, headers []header, body string, timeout int) (ResponseInfo, error) { |
| 483 | parsedURL, err := url.Parse(uri) |
no outgoing calls
no test coverage detected