fix(fetch): add status 205 to null body status check in Response#5208
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Fetch Response implementation to treat HTTP status 205 as a null body status, aligning behavior with the Fetch Standard and fixing #5207.
Changes:
- Add
205to theis_null_body_statuscheck sonew Response("x", { status: 205 })throws aTypeError. - Update the related doc comment and error message to include
205. - Add a regression test that verifies
TypeErroris thrown for204,205, and304when a body is provided.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| core/runtime/src/fetch/response.rs | Extends null-body-status detection + updates error message/doc comment to include 205. |
| core/runtime/src/fetch/tests/response.rs | Adds a consolidated regression test for 204/205/304 body rejection in the constructor. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test262 conformance changes
Tested main commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5208 +/- ##
===========================================
+ Coverage 47.24% 59.82% +12.58%
===========================================
Files 476 582 +106
Lines 46892 63460 +16568
===========================================
+ Hits 22154 37967 +15813
- Misses 24738 25493 +755 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This Pull Request fixes/closes #5207.
It changes the following:
205to theis_null_body_statuscheck inresponse.rssonew Response("x", { status: 205 })throws aTypeError.205.204,205, and304.Testing:
cargo test -p boa_runtime response -- --nocaptureSpec reference: https://fetch.spec.whatwg.org/#null-body-status