MCPcopy
hub / github.com/tinyauthapp/tinyauth / SanitizeHeader

Function SanitizeHeader

internal/utils/label_utils.go:26–34  ·  view source on GitHub ↗
(header string)

Source from the content-addressed store, hash-verified

24}
25
26func SanitizeHeader(header string) string {
27 return strings.Map(func(r rune) rune {
28 // Allow only printable ASCII characters (32-126) and safe whitespace (space, tab)
29 if r == ' ' || r == '\t' || (r >= 32 && r <= 126) {
30 return r
31 }
32 return -1
33 }, header)
34}

Callers 3

TestSanitizeHeaderFunction · 0.92
proxyHandlerMethod · 0.92
ParseHeadersFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestSanitizeHeaderFunction · 0.74