add RelativePath

This commit is contained in:
youngblood 2018-07-28 13:14:47 +08:00
parent cbd27b8f80
commit 91af378995

2
gin.go
View File

@ -377,7 +377,7 @@ func (engine *Engine) handleHTTPRequest(c *Context) {
if engine.HandleMethodNotAllowed {
for _, tree := range engine.trees {
if tree.method != httpMethod {
if handlers, _, _ := tree.root.getValue(path, nil, unescape); handlers != nil {
if handlers, _, _, _ := tree.root.getValue(path, nil, unescape); handlers != nil {
c.handlers = engine.allNoMethod
serveError(c, http.StatusMethodNotAllowed, default405Body)
return