tester
This commit is contained in:
parent
1ed87b4d3a
commit
9e234e9178
15
main.go
15
main.go
@ -216,7 +216,20 @@ func main() {
|
||||
|
||||
server := &http.Server{
|
||||
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,
|
||||
WriteTimeout: 30 * time.Second,
|
||||
IdleTimeout: 60 * time.Second,
|
||||
|
Loading…
x
Reference in New Issue
Block a user