Blocking assets: treat non-cacheable and zero-size responses as error…#2418
Blocking assets: treat non-cacheable and zero-size responses as error…#2418tejas0306 wants to merge 1 commit intoWordPress:trunkfrom
Conversation
fixes WordPress#2417) - Return WP_Error for empty response body (0 bytes) - Return WP_Error when Cache-Control contains no-store or no-cache - Add tests for zero_size and non_cacheable cases Fixes WordPress#2417
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #2418 +/- ##
==========================================
+ Coverage 69.33% 69.40% +0.06%
==========================================
Files 90 90
Lines 7749 7765 +16
==========================================
+ Hits 5373 5389 +16
Misses 2376 2376
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Fixes #2417
This PR improves error handling for invalid and non-cacheable HTTP responses.
Changes
WP_Errorwhen response body is empty (0 bytes)WP_ErrorwhenCache-Controlcontainsno-storeorno-cacheTechnical Notes