mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-18 22:49:52 +02:00
updated implementation of rules
This commit is contained in:
20
internal/net/http/methods.go
Normal file
20
internal/net/http/methods.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package http
|
||||
|
||||
import "net/http"
|
||||
|
||||
var validMethods = map[string]struct{}{
|
||||
http.MethodGet: {},
|
||||
http.MethodHead: {},
|
||||
http.MethodPost: {},
|
||||
http.MethodPut: {},
|
||||
http.MethodPatch: {},
|
||||
http.MethodDelete: {},
|
||||
http.MethodConnect: {},
|
||||
http.MethodOptions: {},
|
||||
http.MethodTrace: {},
|
||||
}
|
||||
|
||||
func IsMethodValid(method string) bool {
|
||||
_, ok := validMethods[method]
|
||||
return ok
|
||||
}
|
||||
Reference in New Issue
Block a user