updated implementation of rules

This commit is contained in:
yusing
2025-01-08 13:50:10 +08:00
parent bc1702e6cf
commit a98b2bb71a
12 changed files with 775 additions and 371 deletions

View 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
}