fix(fetch): set correct type for Response.redirect()#5212
fix(fetch): set correct type for Response.redirect()#5212HiteshShonak wants to merge 1 commit intoboa-dev:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aligns Boa’s Response.redirect() behavior with the Fetch Standard by ensuring newly created redirect responses have type === "default" (not "basic"), and adds a regression test to prevent reintroducing the bug reported in #5211.
Changes:
- Update
Response.redirect()to construct responses withResponseType::Default. - Add a regression test asserting
Response.redirect(...).typeis"default"(with and without an explicit redirect status).
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 | Fixes Response.redirect() to set the response type to Default per spec. |
| core/runtime/src/fetch/tests/response.rs | Adds a regression test to assert the redirect response type is "default". |
💡 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 #5212 +/- ##
===========================================
+ Coverage 47.24% 59.81% +12.56%
===========================================
Files 476 582 +106
Lines 46892 63460 +16568
===========================================
+ Hits 22154 37956 +15802
- Misses 24738 25504 +766 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This Pull Request fixes/closes #5211.
It changes the following:
ResponseType::BasictoResponseType::DefaultinResponse.redirect()- a new response type is"default"unless stated otherwise per the Fetch Standard.Response.redirect().type === "default".Testing:
cargo test -p boa_runtime response -- --nocaptureSpec reference: https://fetch.spec.whatwg.org/#dom-response-redirect