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

Function untilEOL

midway/relay/http.go:94–99  ·  view source on GitHub ↗

untilEOL returns v, truncated before the first '\n' byte, if any. The returned slice may include a '\r' at the end.

(v []byte)

Source from the content-addressed store, hash-verified

92// untilEOL returns v, truncated before the first '\n' byte, if any.
93// The returned slice may include a '\r' at the end.
94func untilEOL(v []byte) []byte {
95 if i := bytes.IndexByte(v, '\n'); i != -1 {
96 return v[:i]
97 }
98 return v
99}

Callers 1

httpHostHeaderFromBytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected