mirror of
https://github.com/vbatts/imgsrv.git
synced 2024-12-26 15:56:31 +00:00
using an outside favicon
This commit is contained in:
parent
7688ec2e10
commit
1e2c4bf3a3
1 changed files with 3 additions and 11 deletions
14
server.go
14
server.go
|
@ -28,7 +28,9 @@ func runServer(ip, port string) {
|
||||||
defer mongo_session.Close()
|
defer mongo_session.Close()
|
||||||
|
|
||||||
http.HandleFunc("/", routeRoot)
|
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("/assets/", routeAssets)
|
||||||
http.HandleFunc("/upload", routeUpload)
|
http.HandleFunc("/upload", routeUpload)
|
||||||
http.HandleFunc("/urlie", routeGetFromUrl)
|
http.HandleFunc("/urlie", routeGetFromUrl)
|
||||||
|
@ -517,16 +519,6 @@ func routeIPs(w http.ResponseWriter, r *http.Request) {
|
||||||
httplog.LogRequest(r, 200)
|
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
|
GET /urlie
|
||||||
POST /urlie
|
POST /urlie
|
||||||
|
|
Loading…
Reference in a new issue