Handle MixCase queries again.

Thanks Ask for reporting.
This commit is contained in:
Miek Gieben 2013-07-25 08:32:10 +01:00
parent dbef97abad
commit ac0703bbe6
1 changed files with 6 additions and 1 deletions

View File

@ -168,10 +168,15 @@ func (mux *ServeMux) match(q string, t uint16) Handler {
mux.m.RLock()
defer mux.m.RUnlock()
var handler Handler
b := make([]byte, len(q)) // worst case, one label of length q
off := 0
end := false
for {
if h, ok := mux.z[q[off:]]; ok {
l := len(q[off:])
for i := 0; i < l; i++ {
b[i] = q[off+i] | ( 'a' - 'A')
}
if h, ok := mux.z[string(b[:l])]; ok { // 'causes garbage, might want to change the map key
if t != TypeDS {
return h
} else {