Add logo for favicon

This commit is contained in:
Anders Pitman 2020-10-21 10:53:51 -06:00
parent afd58db9b7
commit f9f2155ab1
2 changed files with 15 additions and 1 deletions

View File

@ -194,6 +194,20 @@ func (h *WebUiHandler) handleWebUiRequest(w http.ResponseWriter, r *http.Request
h.alertDialog(w, r, "Not authorized", "/#/tunnels") h.alertDialog(w, r, "Not authorized", "/#/tunnels")
return return
} }
case "/logo.png":
logoPngBytes, err := box.Bytes("logo.png")
if err != nil {
w.WriteHeader(500)
h.alertDialog(w, r, err.Error(), homePath)
return
}
w.Header()["Content-Type"] = []string{"image/png"}
w.Header()["Cache-Control"] = []string{"max-age=86400"}
w.Write(logoPngBytes)
case "/": case "/":
indexTmplStr, err := h.box.String("index.tmpl") indexTmplStr, err := h.box.String("index.tmpl")
if err != nil { if err != nil {

View File

@ -3,7 +3,7 @@
<title>boringproxy</title> <title>boringproxy</title>
<link rel="icon" href="data:image/gif;base64,R0lGODlhEAAQAAAAACwAAAAAAQABAAACASgAOw=="> <link rel="icon" href="/logo.png">
<style> <style>
{{.Styles}} {{.Styles}}