From 1886d94e95825ad10410a413a685f6eb7557b776 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 17 May 2017 11:57:52 -0700 Subject: [PATCH] server/mux: Use constants provided by Go http (#4360) --- cmd/server-mux.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/cmd/server-mux.go b/cmd/server-mux.go index 2e3128526..c7ca9f163 100644 --- a/cmd/server-mux.go +++ b/cmd/server-mux.go @@ -42,19 +42,22 @@ const ( maxHTTPVerbLen = 7 ) +// HTTP2 PRI method. +var httpMethodPRI = "PRI" + var defaultHTTP2Methods = []string{ - "PRI", + httpMethodPRI, } var defaultHTTP1Methods = []string{ - "OPTIONS", - "GET", - "HEAD", - "POST", - "PUT", - "DELETE", - "TRACE", - "CONNECT", + http.MethodOptions, + http.MethodGet, + http.MethodHead, + http.MethodPost, + http.MethodPut, + http.MethodDelete, + http.MethodTrace, + http.MethodConnect, } // ConnMux - Peeks into the incoming connection for relevant