mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-10 01:20:58 +01:00
Added favicon handler to serve favicon.png
This commit is contained in:
parent
0a43aab8f5
commit
a594f9be98
@ -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))
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user