1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-22 04:17:03 +00:00

Update to 7.0.5 | Dynamic and static paths are not in conflict anymore.

Read more at: https://github.com/kataras/iris/blob/master/HISTORY.md


Former-commit-id: b636d25c141ebdd5ad095ae9271433876a96e7ff
This commit is contained in:
kataras
2017-06-11 23:07:50 +03:00
parent 5fa9789c35
commit d031ad55b8
21 changed files with 545 additions and 651 deletions

View File

@@ -189,8 +189,9 @@ func convertTmplToNodePath(tmpl *macro.Template) (string, error) {
for i, p := range tmpl.Params {
if p.Type == ast.ParamTypePath {
if i != len(tmpl.Params)-1 {
return "", errors.New("parameter type \"ParamTypePath\" is allowed to exists to the very last of a path")
return "", errors.New("parameter type \"ParamTypePath\" should be putted to the very last of a path")
}
routePath = strings.Replace(routePath, p.Src, WildcardParam(p.Name), 1)
} else {
routePath = strings.Replace(routePath, p.Src, Param(p.Name), 1)
@@ -202,6 +203,7 @@ func convertTmplToNodePath(tmpl *macro.Template) (string, error) {
// note: returns nil if not needed, the caller(router) should be check for that before adding that on route's Middleware
func convertTmplToHandler(tmpl *macro.Template) context.Handler {
needMacroHandler := false
// check if we have params like: {name:string} or {name} or {anything:path} without else keyword or any functions used inside these params.