security fix: Uncontrolled resource consumption (Slowloris)

This commit is contained in:
nemunaire 2023-07-14 16:37:00 +02:00
commit 499e251796
5 changed files with 28 additions and 8 deletions

View file

@ -50,8 +50,12 @@ func NewApp(baseURL string) App {
func (app *App) Start(bind string) {
app.srv = &http.Server{
Addr: bind,
Handler: app.router,
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 {