Skip to content

Commit

Permalink
fix/header-timeout: adding ReadTimeout values
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhuie19 committed May 30, 2023
1 parent 29bb12f commit 51d433a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"net"
"net/http"
"sync"
"time"

"github.com/google/uuid"
"github.com/gorilla/websocket"
Expand Down Expand Up @@ -89,7 +90,8 @@ func (s *Server) Serve(lis net.Listener) {
})

hcsrv := &http.Server{
Handler: hchandler,
Handler: hchandler,
ReadTimeout: 5 * time.Second,
}

//nolint:errcheck
Expand All @@ -101,8 +103,9 @@ func (s *Server) Serve(lis net.Listener) {
wshandler := http.NewServeMux()
wshandler.HandleFunc("/", s.wshandler)
wssrv := &http.Server{
TLSConfig: s.opts.creds.Config,
Handler: wshandler,
TLSConfig: s.opts.creds.Config,
Handler: wshandler,
ReadTimeout: 10 * time.Second,
}

//nolint:errcheck
Expand Down

0 comments on commit 51d433a

Please sign in to comment.