Skip to content

Commit ef0dc27

Browse files
committed
gateway: cleanup logic
License: MIT Signed-off-by: Steven Allen <[email protected]> This commit was moved from ipfs/kubo@725e684
1 parent 13bce94 commit ef0dc27

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

gateway/core/corehttp/gateway_handler.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,11 @@ func (i *gatewayHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
9595
}
9696
}
9797

98-
if r.Method == http.MethodGet || r.Method == http.MethodHead {
98+
switch r.Method {
99+
case http.MethodGet, http.MethodHead:
99100
i.getOrHeadHandler(w, r)
100101
return
101-
}
102-
103-
if r.Method == http.MethodOptions {
102+
case http.MethodOptions:
104103
i.optionsHandler(w, r)
105104
return
106105
}

0 commit comments

Comments
 (0)