Empty string check (#1101)

This commit is contained in:
田欧
2017-09-28 11:22:35 -05:00
committed by Bo-Yi Wu
parent f7376f7c7f
commit 3b300929e8
5 changed files with 11 additions and 12 deletions

2
gin.go
View File

@ -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)