mirror of
https://github.com/gin-gonic/gin.git
synced 2025-06-03 13:11:27 +08:00
Empty string check (#1101)
This commit is contained in:
2
gin.go
2
gin.go
@ -231,7 +231,7 @@ func (engine *Engine) rebuild405Handlers() {
|
||||
|
||||
func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {
|
||||
assert1(path[0] == '/', "path must begin with '/'")
|
||||
assert1(len(method) > 0, "HTTP method can not be empty")
|
||||
assert1(method != "", "HTTP method can not be empty")
|
||||
assert1(len(handlers) > 0, "there must be at least one handler")
|
||||
|
||||
debugPrintRoute(method, path, handlers)
|
||||
|
Reference in New Issue
Block a user