MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / writeHeaders

Function writeHeaders

internal/runtime/executor/helps/logging_helpers.go:560–584  ·  view source on GitHub ↗
(builder *strings.Builder, headers http.Header)

Source from the content-addressed store, hash-verified

558}
559
560func writeHeaders(builder *strings.Builder, headers http.Header) {
561 if builder == nil {
562 return
563 }
564 if len(headers) == 0 {
565 builder.WriteString("<none>\n")
566 return
567 }
568 keys := make([]string, 0, len(headers))
569 for key := range headers {
570 keys = append(keys, key)
571 }
572 sort.Strings(keys)
573 for _, key := range keys {
574 values := headers[key]
575 if len(values) == 0 {
576 builder.WriteString(fmt.Sprintf("%s:\n", key))
577 continue
578 }
579 for _, value := range values {
580 masked := util.MaskSensitiveHeaderValue(key, value)
581 builder.WriteString(fmt.Sprintf("%s: %s\n", key, masked))
582 }
583 }
584}
585
586func formatAuthInfo(info UpstreamRequestLog) string {
587 var parts []string

Callers 5

RecordAPIRequestFunction · 0.85
AppendAPIResponseChunkFunction · 0.85

Calls 2

MaskSensitiveHeaderValueFunction · 0.92
WriteStringMethod · 0.80

Tested by

no test coverage detected