mirror of
https://github.com/yusing/godoxy.git
synced 2026-02-24 17:54:57 +01:00
21 lines
320 B
Go
21 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
|
|
}
|
|
}
|