cleanup
This commit is contained in:
1 parent
2bbc426bef
commit
4553cd0261
2 files changed
+5
-6
No files matched your search
@@ -13,7 +13,6 @@ import (
|
||||
const (
|
||||
ApplyCommandEvent = "CONFIG_CLUSTER:APPLY_COMMAND"
|
||||
|
||||
TokenParam = "token"
|
||||
ClusterParam = "cluster"
|
||||
)
|
||||
const (
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
package mux
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"bytes"
|
||||
)
|
||||
|
||||
type Matcher func([]byte) bool
|
||||
@@ -34,11 +34,11 @@ func HTTP1() Matcher {
|
||||
l = len(data)
|
||||
}
|
||||
methodB := data[:l]
|
||||
ss := strings.Split(string(methodB), " ")
|
||||
if len(ss) == 0 {
|
||||
words := bytes.Split(methodB, []byte(" "))
|
||||
if len(words) == 0 {
|
||||
return false
|
||||
}
|
||||
_, knownMethod := httpMethods[ss[0]]
|
||||
return knownMethod
|
||||
_, ok := httpMethods[string(words[0])]
|
||||
return ok
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user