mirror of
https://github.com/kataras/iris.git
synced 2025-12-24 05:17:03 +00:00
asthetics
Former-commit-id: 1b13823e4e31327dad280a82252be969f845efe8
This commit is contained in:
@@ -325,16 +325,7 @@ func (r *Route) IsStatic() bool {
|
||||
// if /assets/{filepath:path} it will return /assets.
|
||||
func (r *Route) StaticPath() string {
|
||||
src := r.tmpl.Src
|
||||
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)
|
||||
return staticPath(src)
|
||||
}
|
||||
|
||||
// ResolvePath returns the formatted path's %v replaced with the args.
|
||||
|
||||
Reference in New Issue
Block a user