ServeMux's match should only case fold A-Z

This commit is contained in:
Andrew Tunnell-Jones 2013-12-14 11:02:38 +11:00 committed by Miek Gieben
parent e716c3fe8c
commit 58bb85e9b4
1 changed files with 4 additions and 1 deletions

View File

@ -106,7 +106,10 @@ func (mux *ServeMux) match(q string, t uint16) Handler {
for {
l := len(q[off:])
for i := 0; i < l; i++ {
b[i] = q[off+i] | ('a' - 'A')
b[i] = q[off+i]
if b[i] >= 'A' && b[i] <= 'Z' {
b[i] |= ('a' - 'A')
}
}
if h, ok := mux.z[string(b[:l])]; ok { // 'causes garbage, might want to change the map key
if t != TypeDS {