mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(http): set ReadHeaderTimeout to mitigate Slowloris (#946)
* fix(http): add header timeout for connections * fix: add import --------- Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
This commit is contained in:
parent
ccabe96bdf
commit
8bef297841
1 changed files with 2 additions and 0 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/autobrr/autobrr/internal/config"
|
||||
"github.com/autobrr/autobrr/internal/database"
|
||||
|
@ -81,6 +82,7 @@ func (s Server) Open() error {
|
|||
|
||||
server := http.Server{
|
||||
Handler: s.Handler(),
|
||||
ReadHeaderTimeout: time.Second * 15,
|
||||
}
|
||||
|
||||
s.log.Info().Msgf("Starting server. Listening on %s", listener.Addr().String())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue