Skip to content

fix(fetch): add status 205 to null body status check in Response#5208

Merged
jedel1043 merged 1 commit intoboa-dev:mainfrom
HiteshShonak:fix/response-null-body-status-205
Apr 6, 2026
Merged

fix(fetch): add status 205 to null body status check in Response#5208
jedel1043 merged 1 commit intoboa-dev:mainfrom
HiteshShonak:fix/response-null-body-status-205

Conversation

@HiteshShonak
Copy link
Copy Markdown
Contributor

This Pull Request fixes/closes #5207.

It changes the following:

  • Add 205 to the is_null_body_status check in response.rs so new Response("x", { status: 205 }) throws a TypeError.
  • Update the error message and doc comment to include 205.
  • Add a consolidated regression test covering 204, 205, and 304.

Testing:

cargo test -p boa_runtime response -- --nocapture

Spec reference: https://fetch.spec.whatwg.org/#null-body-status

@HiteshShonak HiteshShonak requested a review from a team as a code owner March 21, 2026 07:28
Copilot AI review requested due to automatic review settings March 21, 2026 07:28
@github-actions github-actions bot added C-Tests Issues and PRs related to the tests. C-Runtime Issues and PRs related to Boa's runtime features Waiting On Review Waiting on reviews from the maintainers labels Mar 21, 2026
@github-actions github-actions bot added this to the v1.0.0 milestone Mar 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 205 to the is_null_body_status check so new Response("x", { status: 205 }) throws a TypeError.
  • Update the related doc comment and error message to include 205.
  • Add a regression test that verifies TypeError is thrown for 204, 205, and 304 when 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.

@github-actions
Copy link
Copy Markdown

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 50,539 50,539 0
Ignored 1,426 1,426 0
Failed 998 998 0
Panics 2 2 0
Conformance 95.42% 95.42% 0.00%

Tested main commit: 58a24587890677d94618259dfaa5f257ab5ef9c9
Tested PR commit: 4fb5b6e8c3440412fbae91ba1dfa6fdc10a2aadd
Compare commits: 58a2458...4fb5b6e

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.82%. Comparing base (6ddc2b4) to head (4fb5b6e).
⚠️ Report is 937 commits behind head on main.

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.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@jedel1043 jedel1043 added this pull request to the merge queue Apr 6, 2026
Merged via the queue into boa-dev:main with commit 72ddd2f Apr 6, 2026
25 of 26 checks passed
@github-actions github-actions bot removed the Waiting On Review Waiting on reviews from the maintainers label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Runtime Issues and PRs related to Boa's runtime features C-Tests Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Response constructor accepts body for status 205 instead of throwing

3 participants