1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00
Former-commit-id: 5ade70e6133406c8bbb4ecef36541fdd0d857f6f
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-12-21 14:42:39 +02:00
parent 67341251b8
commit 5cbc3d6827
4 changed files with 61 additions and 5 deletions

View File

@@ -199,14 +199,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 {