-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
Fix use of HTTPS proxies #1070 #1077
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1077 +/- ##
==========================================
+ Coverage 86.23% 86.29% +0.06%
==========================================
Files 62 62
Lines 5885 5889 +4
==========================================
+ Hits 5075 5082 +7
+ Misses 810 807 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
41cd7f6
to
26cd919
Compare
sorry for delay! Kids got hand foot mouth sequentially and I've been working on getting our condo back on the market due to tenant destruction (pain) with no money (they didn't pay). Will get to this ASAP. |
Ouch, I feel ya! Take your time! |
36cbf21
to
85b4e31
Compare
gonna get this done today! (pep talking myself lol) |
is it possible to use their proxy manager concept to make the logic more similar? would help to maintain going forwards. |
I don't see how. We don't use (proxy) managers at all. We could create a |
I just rebased the PR onto main and added a commit that pulls out session creation into |
ok looks great, we really need to add a proxy test later though. One suggestion, replace: chunked = None
if headers_.get('Transfer-Encoding', '').lower() == 'chunked':
# aiohttp wants chunking as a param, and not a header
headers_.pop('Transfer-Encoding', '')
chunked = True with something like this function after def _chunked(self, headers):
transfer_encoding = headers.get('Transfer-Encoding', '')
if chunked := transfer_encoding.lower() == 'chunked':
# aiohttp wants chunking as a param, and not a header
headers.pop('Transfer-Encoding', '')
return chunked so it matches botocore some more. |
oh and then |
thank you and sorry for the delays! finally finished the painting, now for all the other 1000 tiny things to fix lol |
request.method, | ||
url=url, | ||
chunked=chunked, | ||
chunked=self._chunked(headers_), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need to deal with chunked
at all. To me it seems that aiohttp is able to handle that internally at least since aio-libs/aiohttp@2c85834.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, seems like there's test coverage so it seems like you could pull it out to see what happens (assuming it's an integration test to ensure it's testing w/ aiohttp and moto)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
although I'd open an issue with comments for better testing in this area as well to do later unless you feel very motivated :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see what happens: #1096
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
although I'd open an issue with comments for better testing in this area as well to do later unless you feel very motivated :)
Unit tests in what's still an unfamiliar codebase are not my strong suit :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see what happens: #1096
CI doesn't complain, but I'm not sure that's enough evidence. Maybe aiohttp folks can weigh in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can just add a test later, i think werkzerg via moto should be able to handle it
4bc485a
to
725891d
Compare
I have no idea, why CI is failing. This should be unrelated to this PR. |
hmm:
https://github.com/aio-libs/aiobotocore/actions/runs/8129847790/job/22217412080?pr=1077 |
hmm, also seeing an xml parse error, I wonder if it's moto that got upgraded |
For some reason chunked=None is not equivalent to chunked=False. I just reverted to the old logic and now CI is passing. |
thank you so much, sorry for delay! |
Thanks for the thorough review! Much appreciated! |
Description of Change
This PR fixes support for HTTPS proxies.
Assumptions
Connection to the HTTPS proxy and to the HTTPS endpoint may use a single
ssl.SSLContext
.Checklist for All Submissions
ssl.SSLContext
to be used both for connections to the HTTPS proxy as well as the HTTPS endpointChecklist when updating botocore and/or aiohttp versions