1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00
Former-commit-id: 02f6656aceb890217bfc19688d7f45224df274ec
This commit is contained in:
kataras
2017-06-12 18:23:35 +03:00
parent 6ff4500e3c
commit e4df35e351
10 changed files with 38 additions and 15 deletions

View File

@@ -147,6 +147,7 @@ func (rb *APIBuilder) Handle(method string, registeredPath string, handlers ...c
}
// global
rb.routes.register(r)
// per -party
rb.apiRoutes = append(rb.apiRoutes, r)
// should we remove the rb.apiRoutes on the .Party (new children party) ?, No, because the user maybe use this party later
@@ -163,6 +164,11 @@ func (rb *APIBuilder) Party(relativePath string, handlers ...context.Handler) Pa
parentPath = parentPath[1:] // remove first slash
}
// this is checked later on but for easier debug is better to do it here:
if rb.relativePath[0] == '/' && relativePath[0] == '/' {
parentPath = parentPath[1:] // remove first slash if parent ended with / and new one started with /.
}
fullpath := parentPath + relativePath
// append the parent's +child's handlers
middleware := joinHandlers(rb.middleware, handlers)