mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 12:42:34 +02:00
20 lines
320 B
Go
20 lines
320 B
Go
package gphttp
|
|
|
|
import "net/http"
|
|
|
|
func IsMethodValid(method string) bool {
|
|
switch method {
|
|
case http.MethodGet,
|
|
http.MethodHead,
|
|
http.MethodPost,
|
|
http.MethodPut,
|
|
http.MethodPatch,
|
|
http.MethodDelete,
|
|
http.MethodConnect,
|
|
http.MethodOptions,
|
|
http.MethodTrace:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|