MCPcopy Create free account
hub / github.com/imroc/req / mustHaveFieldNameColon

Function mustHaveFieldNameColon

textproto_reader.go:321–326  ·  view source on GitHub ↗

mustHaveFieldNameColon ensures that, per RFC 7230, the field-name is on a single line, so the first line must contain a colon.

(line []byte)

Source from the content-addressed store, hash-verified

319// field-name is on a single line, so the first line must
320// contain a colon.
321func mustHaveFieldNameColon(line []byte) error {
322 if bytes.IndexByte(line, ':') < 0 {
323 return protocolError(fmt.Sprintf("malformed MIME header: missing colon: %q", line))
324 }
325 return nil
326}
327
328var nl = []byte("\n")
329

Callers

nothing calls this directly

Calls 1

protocolErrorTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…