mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
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:
committed by
Tim Flynn
parent
ebdb9c34bd
commit
4a5746db10
Notes:
github-actions[bot]
2026-02-13 20:28:24 +00:00
Author: https://github.com/Praise-Garfield Commit: https://github.com/LadybirdBrowser/ladybird/commit/4a5746db10f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7934
@@ -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 {});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user