d6dd84d5 by astaxie

favicon.ico default deal with static files

1 parent ce77c273
...@@ -223,6 +223,12 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -223,6 +223,12 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
223 223
224 //static file server 224 //static file server
225 for prefix, staticDir := range StaticDir { 225 for prefix, staticDir := range StaticDir {
226 if r.URL.Path == "/favicon.ico" {
227 file := staticDir + r.URL.Path
228 http.ServeFile(w, r, file)
229 w.started = true
230 return
231 }
226 if strings.HasPrefix(r.URL.Path, prefix) { 232 if strings.HasPrefix(r.URL.Path, prefix) {
227 file := staticDir + r.URL.Path[len(prefix):] 233 file := staticDir + r.URL.Path[len(prefix):]
228 http.ServeFile(w, r, file) 234 http.ServeFile(w, r, file)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!