1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00

Merge branch 'master' into dev

Former-commit-id: d338e6e846b4379199015dc4ae76677b2d8cbe53
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-12-21 14:46:58 +02:00
7 changed files with 71 additions and 11 deletions

View File

@@ -198,14 +198,12 @@ func (api *APIBuilder) Handle(method string, relativePath string, handlers ...co
// This method is used behind the scenes at the `Controller` function
// in order to handle more than one paths for the same controller instance.
func (api *APIBuilder) HandleMany(methodOrMulti string, relativePathorMulti string, handlers ...context.Handler) (routes []*Route) {
trimmedPath := strings.Trim(relativePathorMulti, " ")
trimmedMethod := strings.Trim(methodOrMulti, " ")
// at least slash
// a space
// at least one other slash for the next path
// app.Controller("/user /user{id}", new(UserController))
paths := strings.Split(trimmedPath, " ")
methods := strings.Split(trimmedMethod, " ")
paths := splitPath(relativePathorMulti)
methods := splitMethod(methodOrMulti)
for _, p := range paths {
if p != "" {
for _, method := range methods {