foreachHeaderElement splits v according to the "#rule" construction in RFC 7230 section 7 and calls fn for each non-empty element.
(v string, fn func(string))
| 123 | // foreachHeaderElement splits v according to the "#rule" construction |
| 124 | // in RFC 7230 section 7 and calls fn for each non-empty element. |
| 125 | func foreachHeaderElement(v string, fn func(string)) { |
| 126 | v = textproto.TrimString(v) |
| 127 | if v == "" { |
| 128 | return |
| 129 | } |
| 130 | if !strings.Contains(v, ",") { |
| 131 | fn(v) |
| 132 | return |
| 133 | } |
| 134 | for _, f := range strings.Split(v, ",") { |
| 135 | if f = textproto.TrimString(f); f != "" { |
| 136 | fn(f) |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | // maxPostHandlerReadBytes is the max number of Request.Body bytes not |
| 142 | // consumed by a handler that the server will read from the client |
no outgoing calls
no test coverage detected
searching dependent graphs…