X Tutup
Skip to content

Commit 4e30af4

Browse files
committed
Collapse switch cases.
1 parent 81e58b6 commit 4e30af4

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

metrics/measured_http/http.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,9 @@ func (h *MeasuredHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
6666
// ballooning timeseries with invalid methods from public input.
6767
var method string
6868
switch r.Method {
69-
case http.MethodGet:
70-
fallthrough
71-
case http.MethodHead:
72-
fallthrough
73-
case http.MethodPost:
74-
fallthrough
75-
case http.MethodPut:
76-
fallthrough
77-
case http.MethodPatch:
78-
fallthrough
79-
case http.MethodDelete:
80-
fallthrough
81-
case http.MethodConnect:
82-
fallthrough
83-
case http.MethodOptions:
84-
fallthrough
85-
case http.MethodTrace:
69+
case http.MethodGet, http.MethodHead, http.MethodPost, http.MethodPut,
70+
http.MethodPatch, http.MethodDelete, http.MethodConnect,
71+
http.MethodOptions, http.MethodTrace:
8672
method = r.Method
8773
default:
8874
method = "unknown"

0 commit comments

Comments
 (0)
X Tutup