MCPcopy Create free account
hub / github.com/celzero/midway / httpHostHeaderFromBytes

Function httpHostHeaderFromBytes

midway/relay/http.go:82–90  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

80)
81
82func httpHostHeaderFromBytes(b []byte) string {
83 if i := bytes.Index(b, lfHostColon); i != -1 {
84 return string(bytes.TrimSpace(untilEOL(b[i+len(lfHostColon):])))
85 }
86 if i := bytes.Index(b, lfhostColon); i != -1 {
87 return string(bytes.TrimSpace(untilEOL(b[i+len(lfhostColon):])))
88 }
89 return ""
90}
91
92// untilEOL returns v, truncated before the first '\n' byte, if any.
93// The returned slice may include a '\r' at the end.

Callers 1

httpHostHeaderFunction · 0.85

Calls 1

untilEOLFunction · 0.85

Tested by

no test coverage detected