use http method constant (#2155)

* use http method constant

* fix typo
This commit is contained in:
thinkerou
2019-11-29 07:50:49 +08:00
committed by GitHub
parent 352d69c71f
commit d5f12ac6d7
8 changed files with 369 additions and 369 deletions

View File

@ -99,19 +99,19 @@ func (p *LogFormatterParams) MethodColor() string {
method := p.Method
switch method {
case "GET":
case http.MethodGet:
return blue
case "POST":
case http.MethodPost:
return cyan
case "PUT":
case http.MethodPut:
return yellow
case "DELETE":
case http.MethodDelete:
return red
case "PATCH":
case http.MethodPatch:
return green
case "HEAD":
case http.MethodHead:
return magenta
case "OPTIONS":
case http.MethodOptions:
return white
default:
return reset