mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 07:00:55 +00:00
favicon.ico default deal with static files
This commit is contained in:
parent
ce77c273cf
commit
d6dd84d535
@ -223,6 +223,12 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
||||
|
||||
//static file server
|
||||
for prefix, staticDir := range StaticDir {
|
||||
if r.URL.Path == "/favicon.ico" {
|
||||
file := staticDir + r.URL.Path
|
||||
http.ServeFile(w, r, file)
|
||||
w.started = true
|
||||
return
|
||||
}
|
||||
if strings.HasPrefix(r.URL.Path, prefix) {
|
||||
file := staticDir + r.URL.Path[len(prefix):]
|
||||
http.ServeFile(w, r, file)
|
||||
|
Loading…
Reference in New Issue
Block a user