Commit 090d82d
http: log a warning when a CONNECT response has the wrong version (#1827)
* http: log a warning when a CONNECT response has the wrong version
The issue linkerd/linkerd2#6035 describes a situation where Linkerd
rejects HTTP/1.1 CONNECT requests because the remote (non-Linkerd)
forward proxy returns a successful response that erroneously has the
wrong HTTP version (HTTP/1.0). Since the CONNECT method does not exist
in the HTTP/1.0 protocol, Linkerd does not treat this response as a
CONNECT.
It turns out that in the accursed Real World, some HTTP forward proxies
actually do return the wrong protocol version when successfully handling
CONNECT requests. We don't want to remove the check that the protocol
version is correct, because it could lead to us incorrectly treating
responses to CONNECTs as establishing a tunnel when they don't actually
do that. However, in order to make it easier for future users who
encounter issues where other proxies return wrong HTTP versions for
CONNECT responses, it might be nice to log a warning, so that users can
determine *why* their CONNECT requests aren't working.
This branch changes the proxy to log a warning if a successful response
to a CONNECT request had the wrong HTTP version. We won't log the
warning if the response is not a success or if the request was not a
CONNECT, so it should only cover this specific case.
* format version with debug
Signed-off-by: Eliza Weisman <[email protected]>1 parent ebcf7cb commit 090d82d
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
244 | 249 | | |
245 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
246 | 258 | | |
247 | 259 | | |
248 | 260 | | |
| |||
252 | 264 | | |
253 | 265 | | |
254 | 266 | | |
255 | | - | |
| 267 | + | |
256 | 268 | | |
257 | 269 | | |
258 | 270 | | |
| |||
0 commit comments