gun
gun copied to clipboard
Accept HTTP/1.0 response to CONNECT
There are still proxies in a wild which respond HTTP/1.0 200
to CONNECT
. With this PR Gun would support those proxies.
Please be more specific. Which proxies?
For example squidproxies.com still sells squid/3.1.23, you could check it with one of IP we bought from them:
curl -kvx 23.19.34.138:8800 https://httpbin.org/ip
(it will give you an error because of authentication, but HTTP/1.0
and squid version is there)
Your curl
command is something else. It's fine to return an HTTP/1.0 for a non-2xx response to a CONNECT request. Gun already handle those cases properly I believe.
It is the HTTP/1.0 2xx responses to CONNECT specifically that are in question here.
In any case I cannot think of a reason why this would create problems. On the other hand it would be good to add a comment explaining why we also accept HTTP/1.0 and that it is unlikely to cause problems because the tunnel takes over the entire connection.
Also one or more tests to confirm that the code behaves as intended.
This has been fixed today. Closing, thanks!