Merge pull request #826 from SnailKnows/patch-2

Update beego.go
This commit is contained in:
astaxie 2014-09-23 00:31:21 +08:00
commit e1475b72b9
1 changed files with 4 additions and 0 deletions

View File

@ -308,6 +308,10 @@ func SetStaticPath(url string, path string) *App {
// DelStaticPath removes the static folder setting in this url pattern in beego application.
func DelStaticPath(url string) *App {
if !strings.HasPrefix(url, "/") {
url = "/" + url
}
url = strings.TrimRight(url, "/")
delete(StaticDir, url)
return BeeApp
}