diff options
Diffstat (limited to 'routers/web/base.go')
-rw-r--r-- | routers/web/base.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/base.go b/routers/web/base.go index a284dd0288..e43f36a97b 100644 --- a/routers/web/base.go +++ b/routers/web/base.go @@ -25,7 +25,7 @@ func avatarStorageHandler(storageSetting *setting.Storage, prefix string, objSto if storageSetting.ServeDirect() { return func(w http.ResponseWriter, req *http.Request) { - if req.Method != "GET" && req.Method != "HEAD" { + if req.Method != http.MethodGet && req.Method != http.MethodHead { http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed) return } @@ -56,7 +56,7 @@ func avatarStorageHandler(storageSetting *setting.Storage, prefix string, objSto } return func(w http.ResponseWriter, req *http.Request) { - if req.Method != "GET" && req.Method != "HEAD" { + if req.Method != http.MethodGet && req.Method != http.MethodHead { http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed) return } |