You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: map proxy errors to correct HTTP status codes
Previously, the apiserver-network-proxy returned a blanket 503 (Service
Unavailable) status for all backend connection failures, which was
incorrect for a proxy server. Additionally, HTTP CONNECT mode would send
200 OK immediately after hijacking, preventing proper error reporting
but also violating HTTP CONNECT protocol
This commit:
- Adds mapDialErrorToHTTPStatus() to map TCP/network errors to appropriate
HTTP status codes:
* 502 Bad Gateway: connection refused, DNS failures, network unreachable
* 503 Service Unavailable: resource exhaustion (too many open files)
* 504 Gateway Timeout: I/O timeouts, deadline exceeded
- Delays sending "200 Connection Established" until after successful
backend connection in HTTP CONNECT mode
- Ensures proper HTTP/1.1 protocol version in error responses
- Preserves original error messages in response body for debugging
Signed-off-by: Imran Pochi <[email protected]>
0 commit comments