diff options
author | Wim <wim@42.be> | 2019-06-16 23:33:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-16 23:33:25 +0200 |
commit | cb712ff37d3c20a21695e00c52fff213a6fd40b4 (patch) | |
tree | 0ba0ee4f55bf6ace2656562465cc82d807e741b9 /vendor/github.com/labstack/echo/v4/router.go | |
parent | f4ae61044888f591830e6c1be9a2bdb14f88943e (diff) | |
download | matterbridge-msglm-cb712ff37d3c20a21695e00c52fff213a6fd40b4.tar.gz matterbridge-msglm-cb712ff37d3c20a21695e00c52fff213a6fd40b4.tar.bz2 matterbridge-msglm-cb712ff37d3c20a21695e00c52fff213a6fd40b4.zip |
Update vendor (#852)
Diffstat (limited to 'vendor/github.com/labstack/echo/v4/router.go')
-rw-r--r-- | vendor/github.com/labstack/echo/v4/router.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/vendor/github.com/labstack/echo/v4/router.go b/vendor/github.com/labstack/echo/v4/router.go index 73f0b68b..8d3a0180 100644 --- a/vendor/github.com/labstack/echo/v4/router.go +++ b/vendor/github.com/labstack/echo/v4/router.go @@ -33,6 +33,7 @@ type ( propfind HandlerFunc put HandlerFunc trace HandlerFunc + report HandlerFunc } ) @@ -57,7 +58,7 @@ func NewRouter(e *Echo) *Router { func (r *Router) Add(method, path string, h HandlerFunc) { // Validate path if path == "" { - panic("echo: path cannot be empty") + path = "/" } if path[0] != '/' { path = "/" + path @@ -79,14 +80,13 @@ func (r *Router) Add(method, path string, h HandlerFunc) { if i == l { r.insert(method, path[:i], h, pkind, ppath, pnames) - return + } else { + r.insert(method, path[:i], nil, pkind, "", nil) } - r.insert(method, path[:i], nil, pkind, "", nil) } else if path[i] == '*' { r.insert(method, path[:i], nil, skind, "", nil) pnames = append(pnames, "*") r.insert(method, path[:i+1], h, akind, ppath, pnames) - return } } @@ -248,6 +248,8 @@ func (n *node) addHandler(method string, h HandlerFunc) { n.methodHandler.put = h case http.MethodTrace: n.methodHandler.trace = h + case REPORT: + n.methodHandler.report = h } } @@ -273,6 +275,8 @@ func (n *node) findHandler(method string) HandlerFunc { return n.methodHandler.put case http.MethodTrace: return n.methodHandler.trace + case REPORT: + return n.methodHandler.report default: return nil } |