security fix: Uncontrolled resource consumption (Slowloris)
This commit is contained in:
parent
b3b102b2f4
commit
499e251796
|
@ -60,6 +60,10 @@ func (app *App) Start() {
|
|||
app.srv = &http.Server{
|
||||
Addr: app.bind,
|
||||
Handler: app.router,
|
||||
ReadHeaderTimeout: 15 * time.Second,
|
||||
ReadTimeout: 15 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
IdleTimeout: 30 * time.Second,
|
||||
}
|
||||
|
||||
log.Printf("Ready, listening on %s\n", app.bind)
|
||||
|
|
|
@ -54,6 +54,10 @@ func (app *App) Start() {
|
|||
app.srv = &http.Server{
|
||||
Addr: app.bind,
|
||||
Handler: app.router,
|
||||
ReadHeaderTimeout: 15 * time.Second,
|
||||
ReadTimeout: 15 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
IdleTimeout: 30 * time.Second,
|
||||
}
|
||||
|
||||
log.Printf("Ready, listening on %s\n", app.bind)
|
||||
|
|
|
@ -105,6 +105,10 @@ func main() {
|
|||
|
||||
srv := &http.Server{
|
||||
Addr: *bind,
|
||||
ReadHeaderTimeout: 15 * time.Second,
|
||||
ReadTimeout: 15 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
IdleTimeout: 30 * time.Second,
|
||||
}
|
||||
|
||||
http.HandleFunc("/enqueue", enqueueHandler)
|
||||
|
|
|
@ -52,6 +52,10 @@ func (app *App) Start(bind string) {
|
|||
app.srv = &http.Server{
|
||||
Addr: bind,
|
||||
Handler: app.router,
|
||||
ReadHeaderTimeout: 15 * time.Second,
|
||||
ReadTimeout: 15 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
IdleTimeout: 30 * time.Second,
|
||||
}
|
||||
|
||||
if err := app.srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||
|
|
|
@ -89,6 +89,10 @@ func main() {
|
|||
|
||||
srv := &http.Server{
|
||||
Addr: *bind,
|
||||
ReadHeaderTimeout: 15 * time.Second,
|
||||
ReadTimeout: 15 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
IdleTimeout: 30 * time.Second,
|
||||
}
|
||||
|
||||
// Serve pages
|
||||
|
|
Loading…
Reference in New Issue