vcrpy
vcrpy copied to clipboard
Fix HTTPS proxy handling
When HTTPS requests were made through a proxy, the proxy host name and port ended up in the cassette URLs.
In this PR, I extend the Proxy fixture to handle the CONNECT method, reproduce the bug and fix it.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
3a5ff1c) 92.32% compared to head (53faa64) 92.34%. Report is 1 commits behind head on master.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #809 +/- ##
==========================================
+ Coverage 92.32% 92.34% +0.01%
==========================================
Files 27 27
Lines 1811 1815 +4
Branches 338 339 +1
==========================================
+ Hits 1672 1676 +4
Misses 92 92
Partials 47 47
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Previously you set the host of the proxy server to an explicit 127.0.0.x IP. Is that needed?
Previously you set the host of the proxy server to an explicit 127.0.0.x IP. Is that needed?
Not strictly speaking, just the proxy having a different IP than httpbin was convenient for debugging and made the test a bit more precise. If the URLs vary just by the port number, there can conceivably be a regression uncaught by tests if the host selection logic breaks.
I reverted it to minimize the random changes in the diff when resolving a conflict. Do you think it's worth putting it back?
Ping @graingert, so is this good to go?
Hello, guys, this is a genuine bugfix with a repro.
please merge this
@graingert any chance to merge this before the next release?