1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-23 00:30:56 +00:00

Update beego.go

This commit is contained in:
SnailKnows 2014-09-20 18:56:46 +08:00
parent 6c62198b59
commit 67c0c232a1

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. // DelStaticPath removes the static folder setting in this url pattern in beego application.
func DelStaticPath(url string) *App { func DelStaticPath(url string) *App {
if !strings.HasPrefix(url, "/") {
url = "/" + url
}
url = strings.TrimRight(url, "/")
delete(StaticDir, url) delete(StaticDir, url)
return BeeApp return BeeApp
} }