implement auth, closed and close envelopes

This commit is contained in:
2025-08-30 13:21:06 +01:00
parent 1ba2bb0a9b
commit acee5e3a90
23 changed files with 1186 additions and 44 deletions

View File

@@ -21,6 +21,10 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
} else if r.Header.Get("Accept") == "application/nostr+json" {
s.HandleRelayInfo(w, r)
} else {
http.Error(w, "Upgrade required", http.StatusUpgradeRequired)
if s.mux == nil {
http.Error(w, "Upgrade required", http.StatusUpgradeRequired)
} else {
s.mux.ServeHTTP(w, r)
}
}
}