LibWeb: Set Cookie header on remaining resource requests

This commit is contained in:
Timothy Flynn 2021-04-14 10:41:14 -04:00 committed by Andreas Kling
parent 0cacc52990
commit 0f47a23e8e
Notes: sideshowbarker 2024-07-18 20:18:56 +09:00
4 changed files with 5 additions and 9 deletions

View file

@ -175,8 +175,7 @@ ImageStyleValue::ImageStyleValue(const URL& url, DOM::Document& document)
, m_url(url)
, m_document(document)
{
LoadRequest request;
request.set_url(url);
auto request = LoadRequest::create_for_url_on_page(url, document.page());
set_resource(ResourceLoader::the().load_resource(Resource::Type::Image, request));
}

View file

@ -29,6 +29,7 @@
#include <LibWeb/CSS/CSSImportRule.h>
#include <LibWeb/CSS/Parser/DeprecatedCSSParser.h>
#include <LibWeb/CSS/StyleSheet.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/Loader/CSSLoader.h>
#include <LibWeb/Loader/ResourceLoader.h>
@ -56,8 +57,7 @@ void CSSLoader::load_from_url(const URL& url)
m_style_sheet = CSS::CSSStyleSheet::create({});
m_style_sheet->set_owner_node(&m_owner_element);
LoadRequest request;
request.set_url(url);
auto request = LoadRequest::create_for_url_on_page(url, m_owner_element.document().page());
set_resource(ResourceLoader::the().load_resource(Resource::Type::Generic, request));
}

View file

@ -204,9 +204,7 @@ bool FrameLoader::load(const URL& url, Type type)
return false;
}
LoadRequest request;
request.set_url(url);
auto request = LoadRequest::create_for_url_on_page(url, frame().page());
return load(request, type);
}

View file

@ -202,9 +202,8 @@ DOM::ExceptionOr<void> XMLHttpRequest::send()
return {};
}
LoadRequest request;
auto request = LoadRequest::create_for_url_on_page(request_url, m_window->document().page());
request.set_method(m_method);
request.set_url(request_url);
for (auto& it : m_request_headers)
request.set_header(it.key, it.value);