mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-16 19:59:07 +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"
|
||||||
@@ -94,11 +95,12 @@ func (ph *proxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
// MaxConcurrentStreams: 20,
|
// MaxConcurrentStreams: 20,
|
||||||
// IdleTimeout: 10 * time.Second,
|
// IdleTimeout: 10 * time.Second,
|
||||||
}).ServeConn(serverConn, &http2.ServeConnOpts{
|
}).ServeConn(serverConn, &http2.ServeConnOpts{
|
||||||
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