This commit is contained in:
Lain Iwakura 2025-07-12 19:01:18 +03:00
parent 1ed87b4d3a
commit 9e234e9178
No known key found for this signature in database
GPG Key ID: C7C18257F2ADC6F8

15
main.go
View File

@ -216,7 +216,20 @@ func main() {
server := &http.Server{ server := &http.Server{
Addr: ":" + p, Addr: ":" + p,
Handler: mux, Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Server", "0BSD_FOR_EVERYONE")
w.Header().Set("X-Powered-By", "0BSD_FOR_EVERYONE")
defer func() {
if r := recover(); r != nil {
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.WriteHeader(404)
w.Write([]byte("<html><body><h1>Not Found</h1></body></html>"))
}
}()
mux.ServeHTTP(w, r)
}),
ReadTimeout: 30 * time.Second, ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second, WriteTimeout: 30 * time.Second,
IdleTimeout: 60 * time.Second, IdleTimeout: 60 * time.Second,