Add /favicon.ico route
This commit is contained in:
parent
d40803f165
commit
1e1c8caa53
@ -35,6 +35,10 @@ func staticHandler(c web.C, w http.ResponseWriter, r *http.Request) {
|
|||||||
notFoundHandler(c, w, r)
|
notFoundHandler(c, w, r)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
if path == "/favicon.ico" {
|
||||||
|
path = "/static/images/favicon.gif"
|
||||||
|
}
|
||||||
|
|
||||||
filePath := strings.TrimPrefix(path, "/static/")
|
filePath := strings.TrimPrefix(path, "/static/")
|
||||||
file, err := staticBox.Open(filePath)
|
file, err := staticBox.Open(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -99,6 +99,7 @@ func setup() {
|
|||||||
goji.Delete("/:name", deleteHandler)
|
goji.Delete("/:name", deleteHandler)
|
||||||
|
|
||||||
goji.Get("/static/*", staticHandler)
|
goji.Get("/static/*", staticHandler)
|
||||||
|
goji.Get("/favicon.ico", staticHandler)
|
||||||
goji.Get(nameRe, fileDisplayHandler)
|
goji.Get(nameRe, fileDisplayHandler)
|
||||||
goji.Get(selifRe, fileServeHandler)
|
goji.Get(selifRe, fileServeHandler)
|
||||||
goji.Get(selifIndexRe, unauthorizedHandler)
|
goji.Get(selifIndexRe, unauthorizedHandler)
|
||||||
|
Loading…
Reference in New Issue
Block a user