LibWeb: Correct body null check in navigation params fetch

Step 8 of "create navigation params by fetching" says "if
request's body is null, then set entry's document state's
resource to null." The condition is inverted: it checks
!body().has<Empty>(), entering the block when the body is
non-null instead of null. For GET navigations this is mostly
a no-op since resource is typically already Empty, but for
POST navigations the inverted check incorrectly clears the
POSTResource from the document state, breaking session history
entries that rely on it for form re-submission.
This commit is contained in:
Praise-Garfield
2026-02-13 14:14:33 +00:00
committed by Tim Flynn
parent ebdb9c34bd
commit 4a5746db10
Notes: github-actions[bot] 2026-02-13 20:28:24 +00:00

View File

@@ -994,7 +994,7 @@ static void perform_navigation_params_fetch(JS::Realm& realm, GC::Ref<Navigation
}
// 8. If request's body is null, then set entry's document state's resource to null.
if (!state_holder->request->body().has<Empty>()) {
if (state_holder->request->body().has<Empty>()) {
state_holder->entry->document_state()->set_resource(Empty {});
}