diff --git a/hscontrol/handlers.go b/hscontrol/handlers.go index 0cc5bd36..db1d80f2 100644 --- a/hscontrol/handlers.go +++ b/hscontrol/handlers.go @@ -1,6 +1,8 @@ package hscontrol import ( + "bytes" + _ "embed" "encoding/json" "errors" "fmt" @@ -8,6 +10,7 @@ import ( "net/http" "strconv" "strings" + "time" "github.com/chasefleming/elem-go/styles" "github.com/gorilla/mux" @@ -268,3 +271,10 @@ func (a *AuthProviderWeb) RegisterHandler( writer.WriteHeader(http.StatusOK) writer.Write([]byte(templates.RegisterWeb(registrationId).Render())) } + +//go:embed assets/favicon.png +var favicon[] byte +func FaviconHandler(writer http.ResponseWriter, req *http.Request) { + writer.Header().Set("Content-Type", "image/x-icon") + http.ServeContent(writer, req, "favicon.ico", time.Unix(0, 0), bytes.NewReader(favicon)) +}