favicon.ico default deal with static files
Showing
1 changed file
with
6 additions
and
0 deletions
| ... | @@ -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) | ... | ... |
-
Please register or sign in to post a comment