Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bypass hosts not used on HTTPSConnectionWithTimeout #160

Closed
joaomsan opened this issue Apr 2, 2020 · 6 comments
Closed

Bypass hosts not used on HTTPSConnectionWithTimeout #160

joaomsan opened this issue Apr 2, 2020 · 6 comments

Comments

@joaomsan
Copy link

joaomsan commented Apr 2, 2020

Hello,

I was investigating why a https request that i was doing was using proxy even though i added the host to bypass_hosts.

I found out the the method HTTPConnectionWithTimeout.connect does the following

line 1155 if self.proxy_info and self.proxy_info.isgood() and self.proxy_info.applies_to(self.host):

But the method HTTPSConnectionWithTimeout.connect does the following
line 1287 if self.proxy_info and self.proxy_info.isgood():

I think that the https connections are missing the .applies_to

@temoto
Copy link
Member

temoto commented Apr 2, 2020

Thanks, working on it.

Irrelevant statistics question, do you use httplib2 with Python 3+?

@joaomsan
Copy link
Author

joaomsan commented Apr 2, 2020

Yes, Python 3.6

Thank you for your prompt reply.

@temoto
Copy link
Member

temoto commented Apr 2, 2020

Please, try this patch

pip install https://github.com/httplib2/httplib2/archive/e9a98f93c9e29a886231cf02a10b4dafa6793ef2.zip

@temoto
Copy link
Member

temoto commented Apr 2, 2020

You were right about the problem line, although it works properly in Python 2.

Thanks for bringing this up, I added tests covering full relevant code path.

Sorry for trouble.

@joaomsan
Copy link
Author

joaomsan commented Apr 2, 2020

With this patch its working as expected, the proxy is no longer used.

Thank you very much.

@temoto temoto closed this as completed in e9a98f9 Apr 2, 2020
@temoto
Copy link
Member

temoto commented Apr 2, 2020

@joaomsan please also try pip install httplib2==0.17.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants