forked from mirror/client_golang
Sanitize http method to uppercase
Signed-off-by: glefloch <glfloch@gmail.com>
This commit is contained in:
parent
4eb539fa85
commit
53520d89f6
|
@ -322,23 +322,23 @@ func computeApproximateRequestSize(r *http.Request) int {
|
||||||
func sanitizeMethod(m string) string {
|
func sanitizeMethod(m string) string {
|
||||||
switch m {
|
switch m {
|
||||||
case "GET", "get":
|
case "GET", "get":
|
||||||
return "get"
|
return "GET"
|
||||||
case "PUT", "put":
|
case "PUT", "put":
|
||||||
return "put"
|
return "PUT"
|
||||||
case "HEAD", "head":
|
case "HEAD", "head":
|
||||||
return "head"
|
return "HEAD"
|
||||||
case "POST", "post":
|
case "POST", "post":
|
||||||
return "post"
|
return "POST"
|
||||||
case "DELETE", "delete":
|
case "DELETE", "delete":
|
||||||
return "delete"
|
return "DELETE"
|
||||||
case "CONNECT", "connect":
|
case "CONNECT", "connect":
|
||||||
return "connect"
|
return "CONNECT"
|
||||||
case "OPTIONS", "options":
|
case "OPTIONS", "options":
|
||||||
return "options"
|
return "OPTIONS"
|
||||||
case "NOTIFY", "notify":
|
case "NOTIFY", "notify":
|
||||||
return "notify"
|
return "NOTIFY"
|
||||||
default:
|
default:
|
||||||
return strings.ToLower(m)
|
return strings.ToUpper(m)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue