Update favicon handling and bump version to v0.6.1
- main.go - Removed static favicon serving from `ServeMux`. - Removed import for `net/http`. - pkg/version/version - Updated version from v0.6.0 to v0.6.1. - cmd/lerproxy/main.go - Added embedded support for default favicon using `//go:embed`. - Modified logic to serve favicon as an embedded resource or from file in the same directory as the nostr.json - static/favicon.ico - Deleted static favicon file. - cmd/lerproxy/favicon.ico - Added new file for embedded favicon resource.
This commit is contained in:
9
main.go
9
main.go
@@ -5,7 +5,6 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
|
||||
@@ -78,14 +77,6 @@ func main() {
|
||||
}
|
||||
var opts []options.O
|
||||
serveMux := servemux.NewServeMux()
|
||||
|
||||
// Add favicon handler
|
||||
serveMux.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "image/x-icon")
|
||||
w.Header().Set("Cache-Control", "public, max-age=86400") // Cache for 24 hours
|
||||
http.ServeFile(w, r, "static/favicon.ico")
|
||||
})
|
||||
|
||||
if server, err = relay.NewServer(
|
||||
serverParams, serveMux, opts...,
|
||||
); chk.E(err) {
|
||||
|
||||
Reference in New Issue
Block a user