mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 03:47:04 +00:00
Former-commit-id: 5ade70e6133406c8bbb4ecef36541fdd0d857f6f
This commit is contained in:
@@ -45,6 +45,26 @@ func suffix(s string, suffix string) string {
|
||||
return s
|
||||
}
|
||||
|
||||
func splitMethod(methodMany string) []string {
|
||||
methodMany = strings.Trim(methodMany, " ")
|
||||
return strings.Split(methodMany, " ")
|
||||
}
|
||||
|
||||
func splitPath(pathMany string) (paths []string) {
|
||||
pathMany = strings.Trim(pathMany, " ")
|
||||
pathsWithoutSlashFromFirstAndSoOn := strings.Split(pathMany, " /")
|
||||
for _, path := range pathsWithoutSlashFromFirstAndSoOn {
|
||||
if path == "" {
|
||||
continue
|
||||
}
|
||||
if path[0] != '/' {
|
||||
path = "/" + path
|
||||
}
|
||||
paths = append(paths, path)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func joinPath(path1 string, path2 string) string {
|
||||
return path.Join(path1, path2)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user