Skip to content

Commit 1f1d25d

Browse files
author
Julien Cretel
committed
http/httpguts: eschew UTF-8 decoding in ValidHeaderFieldName
1 parent edec337 commit 1f1d25d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

http/httpguts/httplex.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ func ValidHeaderFieldName(v string) bool {
197197
if len(v) == 0 {
198198
return false
199199
}
200-
for _, r := range v {
201-
if !IsTokenRune(r) {
200+
for i := 0; i < len(v); i++ {
201+
if !isTokenTable[v[i]] {
202202
return false
203203
}
204204
}

0 commit comments

Comments
 (0)