mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
LibWeb: Set Cookie header on <script> resource requests
This required changing the load_sync API to take a LoadRequest instead of just a URL. Since HTMLScriptElement was the only (non-test) user of this API, it didn't seem useful to instead add an overload of load_sync for this.
This commit is contained in:
committed by
Andreas Kling
parent
3cc5286565
commit
347838a240
@@ -224,10 +224,12 @@ void HTMLScriptElement::prepare_script()
|
||||
}
|
||||
|
||||
if (m_script_type == ScriptType::Classic) {
|
||||
auto request = LoadRequest::create_for_url_on_page(url, document().page());
|
||||
|
||||
// FIXME: This load should be made asynchronous and the parser should spin an event loop etc.
|
||||
m_script_filename = url.basename();
|
||||
ResourceLoader::the().load_sync(
|
||||
url,
|
||||
request,
|
||||
[this, url](auto data, auto&, auto) {
|
||||
if (data.is_null()) {
|
||||
dbgln("HTMLScriptElement: Failed to load {}", url);
|
||||
|
||||
Reference in New Issue
Block a user