Skip to content

fix: Restore response_class on every request to prevent status leak - #3784

Merged
ubaskota merged 2 commits into
boto:developfrom
ubaskota:caching_fix_s3_response
Aug 21, 2026
Merged

fix: Restore response_class on every request to prevent status leak#3784
ubaskota merged 2 commits into
boto:developfrom
ubaskota:caching_fix_s3_response

Conversation

@ubaskota

Copy link
Copy Markdown
Contributor

Issue #, if available: #3755

Description of changes:
AWSConnection.request() only restored the response_class override in the non-Expect branch, so a cached status from an early final response could leak onto the next request on a pooled connection, dropping its headers (e.g. a missing S3 ETag). Move the restore so it runs on every request.

Testing

  • Verified that the newly added test passes with the fix and fails without it.
  • Verified that the existing passes

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ubaskota
ubaskota requested a review from a team as a code owner August 21, 2026 01:11
@codecov-commenter

codecov-commenter commented Aug 21, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.47%. Comparing base (ee748e4) to head (d887614).
⚠️ Report is 477 commits behind head on develop.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3784      +/-   ##
===========================================
- Coverage    92.59%   92.47%   -0.13%     
===========================================
  Files           68       68              
  Lines        15634    15859     +225     
===========================================
+ Hits         14477    14666     +189     
- Misses        1157     1193      +36     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread .changes/next-release/bugfix-s3-10143.json Outdated
Comment thread .changes/next-release/bugfix-s3-10143.json Outdated
@ubaskota
ubaskota merged commit 0780108 into boto:develop Aug 21, 2026
49 checks passed
Alan4506 pushed a commit that referenced this pull request Aug 21, 2026
* release-1.43.77:
  Bumping version to 1.43.77
  fix: Restore response_class on every request to prevent status leak (#3784)
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.

4 participants