1
0
Fork 0
mirror of https://github.com/vbatts/imgsrv.git synced 2024-12-25 15:26:30 +00:00

using an outside favicon

This commit is contained in:
Vincent Batts 2013-07-03 11:21:56 -04:00
parent 7688ec2e10
commit 1e2c4bf3a3

View file

@ -28,7 +28,9 @@ func runServer(ip, port string) {
defer mongo_session.Close()
http.HandleFunc("/", routeRoot)
http.HandleFunc("/favicon.ico", routeFavIcon)
http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {
httplog.DefaultFavIcon.ServeHTTP(w, r)
})
http.HandleFunc("/assets/", routeAssets)
http.HandleFunc("/upload", routeUpload)
http.HandleFunc("/urlie", routeGetFromUrl)
@ -517,16 +519,6 @@ func routeIPs(w http.ResponseWriter, r *http.Request) {
httplog.LogRequest(r, 200)
}
/*
GET /favicon.ico
Set an unruly cache on this path, so the browser does not constantly ask for it
*/
func routeFavIcon(w http.ResponseWriter, r *http.Request) {
httplog.LogRequest(r, 200)
w.Header().Set("Cache-Control", "max-age=315360000")
}
/*
GET /urlie
POST /urlie