From 67c0c232a10285eb547ee5b1322b38fd188829c1 Mon Sep 17 00:00:00 2001 From: SnailKnows Date: Sat, 20 Sep 2014 18:56:46 +0800 Subject: [PATCH] Update beego.go --- beego.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/beego.go b/beego.go index 1277a2a8..32c1ee47 100644 --- a/beego.go +++ b/beego.go @@ -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 }