mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-05 21:19:08 +02:00
set 5s ReadTimeout
Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
This commit is contained in:
@@ -3,6 +3,7 @@ package server
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/coder/websocket"
|
"github.com/coder/websocket"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
@@ -97,8 +98,9 @@ func (ph *proxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
Context: ctx,
|
Context: ctx,
|
||||||
Handler: ph.handler,
|
Handler: ph.handler,
|
||||||
BaseConfig: &http.Server{
|
BaseConfig: &http.Server{
|
||||||
// we don't set read/write timeouts here,
|
// this is a per-stream timeout which for an h2c is set on reception of a complete HEADERS frame
|
||||||
// as they interfere with streaming grpc calls
|
// and effectively sets a deadline for reading of complete request body
|
||||||
|
ReadTimeout: 5 * time.Second,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user