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)
| 63 | // fashion. However, header field names MUST be converted to |
| 64 | // lowercase prior to their encoding in HTTP/2. " |
| 65 | func 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 | |
| 80 | func httpCodeString(code int) string { |
| 81 | switch code { |
no outgoing calls
no test coverage detected
searching dependent graphs…