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

Handle 100 Continue in urllib3>=2. #2984

Closed
wants to merge 1 commit into from

Conversation

tjni
Copy link

@tjni tjni commented Jul 18, 2023

This maintains compatibility from urllib3 1.25.4 to urllib3 2.0.3 at least by moving the code in _send_request to request. In urllib3>=2, the _send_request function of http.client.HTTPConnection is skipped in favor of a custom implementation.

Related to #2926.

@codecov-commenter
Copy link

codecov-commenter commented Jul 24, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (59edb73) 93.36% compared to head (560e26f) 93.36%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2984   +/-   ##
========================================
  Coverage    93.36%   93.36%           
========================================
  Files           65       65           
  Lines        13841    13841           
========================================
  Hits         12923    12923           
  Misses         918      918           
Files Changed Coverage Δ
botocore/awsrequest.py 98.55% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This maintains compatibility from urllib3 1.25.4 to urllib3 2.0.3 at
least by moving the code in _send_request to request. In urllib3>=2,
the _send_request function of http.client.HTTPConnection is skipped
in favor of a custom implementation.
@nateprewitt
Copy link
Contributor

Hi @tjni, thanks for this PR! We're working on the fix internally at the moment but this appears to be on the right track. We will be moving to the request wrapper interface provided in CPython's HTTPConnection class but the way urllib3 wrote this creates some performance issues when the body is dropped from a non-100 response.

I'll have a patch to put up once we've resolved those issues. I can either attempt to rebase my changes onto this branch or will post a new PR. Please let me know if you have a preference.

@tjni
Copy link
Author

tjni commented Jul 26, 2023

No preference, except that you do whatever is easiest for you. Thank you for taking a look.

@nateprewitt
Copy link
Contributor

Resolving in favor of #2990. Thanks again, @tjni!

@tjni tjni deleted the expect-header-urllib3-2 branch July 28, 2023 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants