Skip to content

feat: support additional RequestInit fields#4990

Open
sahanaxzy wants to merge 11 commits intoboa-dev:mainfrom
sahanaxzy:feat-fetch-requestinit-fields
Open

feat: support additional RequestInit fields#4990
sahanaxzy wants to merge 11 commits intoboa-dev:mainfrom
sahanaxzy:feat-fetch-requestinit-fields

Conversation

@sahanaxzy
Copy link
Contributor

Summary

Extends RequestInit with standard Fetch options (mode, credentials, cache, redirect, referrer, referrerPolicy, integrity, keepalive), bringing new Request(url, init) closer to browser behavior.

Closes #4987

Changes

Modified fetch/request.rs

  • Added the missing RequestInit fields listed above
  • Added validation for mode, credentials, cache, redirect, and referrerPolicy
  • referrer, integrity, and keepalive are accepted but currently no-ops (ready to wire up later)

Modified fetch/tests/request.rs

  • Added tests for valid mode/credentials acceptance and invalid mode rejection

Testing

cargo fmt --all
cargo test -p boa_runtime --lib
cargo clippy -p boa_runtime --all-features --all-targets

@sahanaxzy sahanaxzy requested a review from a team as a code owner March 10, 2026 23:18
@github-actions
Copy link

github-actions bot commented Mar 10, 2026

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 49,935 49,935 0
Ignored 2,207 2,207 0
Failed 821 821 0
Panics 0 0 0
Conformance 94.28% 94.28% 0.00%

Tested main commit: cffb50c2c37cf7905911ba6446667d8e182d29ad
Tested PR commit: 7fe2c747949959b96273133f6e35af7ed0b02e33
Compare commits: cffb50c...7fe2c74

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 38.09524% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.01%. Comparing base (6ddc2b4) to head (7fe2c74).
⚠️ Report is 860 commits behind head on main.

Files with missing lines Patch % Lines
core/runtime/src/fetch/request.rs 38.09% 39 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4990       +/-   ##
===========================================
+ Coverage   47.24%   59.01%   +11.76%     
===========================================
  Files         476      563       +87     
  Lines       46892    62621    +15729     
===========================================
+ Hits        22154    36954    +14800     
- Misses      24738    25667      +929     

☔ 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.

@sahanaxzy
Copy link
Contributor Author

@jedel1043 can you review this...

@jedel1043 jedel1043 added A-Enhancement New feature or request C-Runtime Issues and PRs related to Boa's runtime features labels Mar 13, 2026
@sahanaxzy sahanaxzy requested a review from jedel1043 March 13, 2026 20:25
@jedel1043 jedel1043 added the Waiting On Author Waiting on PR changes from the author label Mar 16, 2026
@jedel1043
Copy link
Member

Needs rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Enhancement New feature or request C-Runtime Issues and PRs related to Boa's runtime features Waiting On Author Waiting on PR changes from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat : support additional RequestInit fields (mode, credentials, cache, redirect, etc.)

2 participants