|
@@ -12,17 +12,21 @@ import (
|
|
|
)
|
|
|
|
|
|
var (
|
|
|
- readTimeout = 30 * time.Second
|
|
|
- writeTimeout = 30 * time.Second
|
|
|
+ readTimeout = 30 * time.Second
|
|
|
+ readHeaderTimeout = 30 * time.Second
|
|
|
+ writeTimeout = 30 * time.Second
|
|
|
+ idleTimeout = 30 * time.Second
|
|
|
)
|
|
|
|
|
|
func newServe(addr string, router http.Handler) *http.Server {
|
|
|
return &http.Server{
|
|
|
- Addr: addr,
|
|
|
- Handler: router,
|
|
|
- ReadTimeout: readTimeout,
|
|
|
- WriteTimeout: writeTimeout,
|
|
|
- MaxHeaderBytes: MB,
|
|
|
+ Addr: addr,
|
|
|
+ Handler: router,
|
|
|
+ ReadTimeout: readTimeout,
|
|
|
+ ReadHeaderTimeout: readHeaderTimeout,
|
|
|
+ WriteTimeout: writeTimeout,
|
|
|
+ IdleTimeout: idleTimeout,
|
|
|
+ MaxHeaderBytes: MB,
|
|
|
}
|
|
|
}
|
|
|
|