Skip to content

Commit d6845b9

Browse files
blink-so[bot]f0ssel
andcommitted
Add timeout to HTTP client to prevent hanging on network issues
- Add 10 second timeout to outbound HTTP requests - Prevents indefinite hanging when network namespace lacks connectivity - Helps diagnose network setup issues in privileged mode Co-authored-by: f0ssel <[email protected]>
1 parent e3aa2cb commit d6845b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

proxy/proxy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ func (p *Server) forwardHTTPRequest(w http.ResponseWriter, r *http.Request) {
198198

199199
// Create HTTP client
200200
client := &http.Client{
201+
Timeout: 10 * time.Second, // Add timeout to avoid hanging
201202
CheckRedirect: func(req *http.Request, via []*http.Request) error {
202203
return http.ErrUseLastResponse // Don't follow redirects
203204
},

0 commit comments

Comments
 (0)