diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index d9ff2dc8bae..62d151ee4c6 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -95,12 +95,11 @@ func (i *gatewayHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } } - if r.Method == http.MethodGet || r.Method == http.MethodHead { + switch r.Method { + case http.MethodGet, http.MethodHead: i.getOrHeadHandler(w, r) return - } - - if r.Method == http.MethodOptions { + case http.MethodOptions: i.optionsHandler(w, r) return }