Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't return http 200 for ConnectHijack actions
Sending HTTP 200 back to the client connection before invoking the todo.Hijack() method for a ConnectHijack action makes it impossible to cascade the http 502 back to the client in case we wanted to abort prematurely (e.g.the target address is unavailable) [RFC 2817](https://tools.ietf.org/html/rfc2817#section-5.3) States: ``` 5.3 Establishing a Tunnel with CONNECT Any successful (2xx) response to a CONNECT request indicates that the proxy has established a connection to the requested host and port, and has switched to tunneling the current connection to that server connection. ``` It should be therefore up to the Hijack() method implementer to send the http 200 upon confirming that we can establish a tunnel.
- Loading branch information