@cryptotaxi247 / kubo / commits / 725e6844e

gateway: cleanup logic

License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>

Steven Allen committed Feb 26, 2019 at 17:55 UTC 725e6844ee734591022e0ce8ddc0e526241def0d
1 file changed +3 -4
core/corehttp/gateway_handler.go
+3 -4
@@ -95,12 +95,11 @@ func (i *gatewayHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
95 }
96 }
97
98 - if r.Method == http.MethodGet || r.Method == http.MethodHead {
98 + switch r.Method {
99 + case http.MethodGet, http.MethodHead:
100 i.getOrHeadHandler(w, r)
101 return
101 - }
102 -
103 - if r.Method == http.MethodOptions {
102 + case http.MethodOptions:
103 i.optionsHandler(w, r)
104 return
105 }