serve favicon.ico
This commit is contained in:
parent
504f06b15f
commit
1c16b3b4eb
BIN
assets/favicon.ico
Normal file
BIN
assets/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
@ -1,3 +1,3 @@
|
|||||||
package gokrazy
|
package gokrazy
|
||||||
|
|
||||||
//go:generate sh -c "go run goembed.go -package bundled -var assets assets/header.tmpl assets/footer.tmpl assets/overview.tmpl assets/status.tmpl > internal/bundled/GENERATED_bundled.go"
|
//go:generate sh -c "go run goembed.go -package bundled -var assets assets/header.tmpl assets/footer.tmpl assets/overview.tmpl assets/status.tmpl assets/favicon.ico > internal/bundled/GENERATED_bundled.go"
|
||||||
|
File diff suppressed because one or more lines are too long
@ -94,6 +94,11 @@ var overviewTmpl = template.Must(template.Must(commonTmpls.Clone()).New("overvie
|
|||||||
var statusTmpl = template.Must(template.Must(commonTmpls.Clone()).New("statusTmpl").Parse(bundled.Asset("status.tmpl")))
|
var statusTmpl = template.Must(template.Must(commonTmpls.Clone()).New("statusTmpl").Parse(bundled.Asset("status.tmpl")))
|
||||||
|
|
||||||
func initStatus(services []*service) {
|
func initStatus(services []*service) {
|
||||||
|
http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if _, err := w.Write([]byte(bundled.Asset("favicon.ico"))); err != nil {
|
||||||
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
})
|
||||||
http.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) {
|
||||||
token := xsrfTokenFromCookies(r.Cookies())
|
token := xsrfTokenFromCookies(r.Cookies())
|
||||||
if token == 0 {
|
if token == 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user