1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-19 10:57:05 +00:00

General Improvements (UseRouter per Party, fix AutoTLS). Read HISTORY.md

relative to: https://github.com/kataras/iris/issues/1577 and https://github.com/kataras/iris/issues/1578
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-08-12 07:20:07 +03:00
parent da029d6f37
commit 0761bc35ee
15 changed files with 639 additions and 120 deletions

View File

@@ -235,6 +235,14 @@ func splitSubdomainAndPath(fullUnparsedPath string) (subdomain string, path stri
subdomain = s[0:slashIdx]
}
if slashIdx == -1 {
// this will only happen when this function
// is called to Party's relative path (e.g. control.admin.),
// and not a route's one (the route's one always contains a slash).
// return all as subdomain and "/" as path.
return s, "/"
}
path = s[slashIdx:]
if !strings.Contains(path, "{") {
path = strings.ReplaceAll(path, "//", "/")