vcrpy icon indicating copy to clipboard operation
vcrpy copied to clipboard

Fix HTTPS proxy handling

Open alga opened this issue 1 year ago • 7 comments

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.

alga avatar Jan 22 '24 17:01 alga

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.

codecov-commenter avatar Jan 23 '24 02:01 codecov-commenter

Previously you set the host of the proxy server to an explicit 127.0.0.x IP. Is that needed?

graingert avatar Jan 23 '24 15:01 graingert

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?

alga avatar Jan 24 '24 01:01 alga

Ping @graingert, so is this good to go?

alga avatar Mar 13 '24 12:03 alga

Hello, guys, this is a genuine bugfix with a repro.

alga avatar Jul 07 '24 22:07 alga

please merge this

agroszer avatar Jul 29 '24 11:07 agroszer

@graingert any chance to merge this before the next release?

agroszer avatar Jul 30 '24 08:07 agroszer