LibWeb: Respect IncludeCredentials for Set-Cookie during fetch

Per https://fetch.spec.whatwg.org/#http-network-fetch, Set-Cookie should
only store a cookie if IncludeCredentials::Yes is set. Fixes 1 web
platform test.
This commit is contained in:
Julian Dominguez-Schatz 2025-08-23 03:49:58 -04:00 committed by Tim Ledbetter
commit 4e3387778e
Notes: github-actions[bot] 2025-09-24 09:14:19 +00:00
3 changed files with 13 additions and 3 deletions

View file

@ -2315,6 +2315,7 @@ WebIDL::ExceptionOr<GC::Ref<PendingResponse>> nonstandard_resource_loader_file_o
load_request.set_url(request->current_url());
load_request.set_page(page);
load_request.set_method(ByteString::copy(request->method()));
load_request.set_store_set_cookie_headers(include_credentials == IncludeCredentials::Yes);
for (auto const& header : *request->header_list())
load_request.set_header(ByteString::copy(header.name), ByteString::copy(header.value));