mirror of
https://github.com/kataras/iris.git
synced 2025-12-22 04:17:03 +00:00
asthetics
Former-commit-id: 1b13823e4e31327dad280a82252be969f845efe8
This commit is contained in:
@@ -258,6 +258,19 @@ func splitSubdomainAndPath(fullUnparsedPath string) (subdomain string, path stri
|
||||
return // return subdomain without slash, path with slash
|
||||
}
|
||||
|
||||
func staticPath(src string) string {
|
||||
bidx := strings.IndexByte(src, '{')
|
||||
if bidx == -1 || len(src) <= bidx {
|
||||
return src // no dynamic part found
|
||||
}
|
||||
if bidx <= 1 { // found at first{...} or second index (/{...}),
|
||||
// although first index should never happen because of the prepended slash.
|
||||
return "/"
|
||||
}
|
||||
|
||||
return src[:bidx-1] // (/static/{...} -> /static)
|
||||
}
|
||||
|
||||
// RoutePathReverserOption option signature for the RoutePathReverser.
|
||||
type RoutePathReverserOption func(*RoutePathReverser)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user