mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 23:14:59 +00:00
LibWeb/Fetch: Use a basic filtered response for redirect navigations
Match following change in the spec:
8f109835dc
This commit is contained in:
parent
c94924691d
commit
47f03c3a9a
1 changed files with 7 additions and 4 deletions
|
@ -920,15 +920,18 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm& rea
|
||||||
break;
|
break;
|
||||||
// -> "manual"
|
// -> "manual"
|
||||||
case Infrastructure::Request::RedirectMode::Manual:
|
case Infrastructure::Request::RedirectMode::Manual:
|
||||||
// Set response to an opaque-redirect filtered response whose internal response is actualResponse. If
|
// 1. If request’s mode is "navigate", then set fetchParams’s controller’s next manual redirect steps
|
||||||
// request’s mode is "navigate", then set fetchParams’s controller’s next manual redirect steps to run
|
// to run HTTP-redirect fetch given fetchParams and response.
|
||||||
// HTTP-redirect fetch given fetchParams and response.
|
|
||||||
response = Infrastructure::OpaqueRedirectFilteredResponse::create(vm, *actual_response);
|
|
||||||
if (request->mode() == Infrastructure::Request::Mode::Navigate) {
|
if (request->mode() == Infrastructure::Request::Mode::Navigate) {
|
||||||
fetch_params.controller()->set_next_manual_redirect_steps([&realm, &fetch_params, response] {
|
fetch_params.controller()->set_next_manual_redirect_steps([&realm, &fetch_params, response] {
|
||||||
(void)http_redirect_fetch(realm, fetch_params, *response);
|
(void)http_redirect_fetch(realm, fetch_params, *response);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 2. Otherwise, set response to an opaque-redirect filtered response whose internal response is
|
||||||
|
// actualResponse.
|
||||||
|
else {
|
||||||
|
response = Infrastructure::OpaqueRedirectFilteredResponse::create(vm, *actual_response);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
// -> "follow"
|
// -> "follow"
|
||||||
case Infrastructure::Request::RedirectMode::Follow:
|
case Infrastructure::Request::RedirectMode::Follow:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue