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

Function validWireHeaderFieldName

internal/http2/http2.go:65–78  ·  view source on GitHub ↗

validWireHeaderFieldName reports whether v is a valid header field name (key). See httpguts.ValidHeaderName for the base rules. Further, http2 says: "Just as in HTTP/1.x, header field names are strings of ASCII characters that are compared in a case-insensitive fashion. However, header field na

(v string)

Source from the content-addressed store, hash-verified

63// fashion. However, header field names MUST be converted to
64// lowercase prior to their encoding in HTTP/2. "
65func validWireHeaderFieldName(v string) bool {
66 if len(v) == 0 {
67 return false
68 }
69 for _, r := range v {
70 if !httpguts.IsTokenRune(r) {
71 return false
72 }
73 if 'A' <= r && r <= 'Z' {
74 return false
75 }
76 }
77 return true
78}
79
80func httpCodeString(code int) string {
81 switch code {

Callers 1

readMetaFrameMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…