From 4553cd0261d5f2c22dee8917dc30de2669bf9f74 Mon Sep 17 00:00:00 2001 From: Maxim Merzhanov Date: Fri, 22 Nov 2019 18:30:33 +0300 Subject: [PATCH] cleanup --- cluster/const.go | 1 - mux/matchers.go | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cluster/const.go b/cluster/const.go index 6f599fc..c9b6011 100644 --- a/cluster/const.go +++ b/cluster/const.go @@ -13,7 +13,6 @@ import ( const ( ApplyCommandEvent = "CONFIG_CLUSTER:APPLY_COMMAND" - TokenParam = "token" ClusterParam = "cluster" ) const ( diff --git a/mux/matchers.go b/mux/matchers.go index cdc365f..e2490db 100644 --- a/mux/matchers.go +++ b/mux/matchers.go @@ -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 } }