mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 23:39:02 +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:
parent
3cc5286565
commit
347838a240
Notes:
sideshowbarker
2024-07-18 20:19:03 +09:00
Author: https://github.com/trflynn89
Commit: 347838a240
Pull-request: https://github.com/SerenityOS/serenity/pull/6321
4 changed files with 14 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue