Merge pull request #826 from SnailKnows/patch-2
Update beego.go
Showing
1 changed file
with
4 additions
and
0 deletions
| ... | @@ -308,6 +308,10 @@ func SetStaticPath(url string, path string) *App { | ... | @@ -308,6 +308,10 @@ func SetStaticPath(url string, path string) *App { |
| 308 | 308 | ||
| 309 | // DelStaticPath removes the static folder setting in this url pattern in beego application. | 309 | // DelStaticPath removes the static folder setting in this url pattern in beego application. |
| 310 | func DelStaticPath(url string) *App { | 310 | func DelStaticPath(url string) *App { |
| 311 | if !strings.HasPrefix(url, "/") { | ||
| 312 | url = "/" + url | ||
| 313 | } | ||
| 314 | url = strings.TrimRight(url, "/") | ||
| 311 | delete(StaticDir, url) | 315 | delete(StaticDir, url) |
| 312 | return BeeApp | 316 | return BeeApp |
| 313 | } | 317 | } | ... | ... |
-
Please register or sign in to post a comment