first commit
This commit is contained in:
16
internal/httpapi/static.go
Normal file
16
internal/httpapi/static.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package httpapi
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//go:embed static/favicon.ico
|
||||
var faviconICO []byte
|
||||
|
||||
func (s *Server) handleFavicon(w http.ResponseWriter, _ *http.Request) {
|
||||
w.Header().Set("Content-Type", "image/x-icon")
|
||||
w.Header().Set("Cache-Control", "public, max-age=86400")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_, _ = w.Write(faviconICO)
|
||||
}
|
||||
Reference in New Issue
Block a user