mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +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
4 changed files with 14 additions and 6 deletions
|
@ -52,12 +52,12 @@ ResourceLoader::ResourceLoader()
|
|||
{
|
||||
}
|
||||
|
||||
void ResourceLoader::load_sync(const URL& url, Function<void(ReadonlyBytes, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> status_code)> success_callback, Function<void(const String&, Optional<u32> status_code)> error_callback)
|
||||
void ResourceLoader::load_sync(const LoadRequest& request, Function<void(ReadonlyBytes, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> status_code)> success_callback, Function<void(const String&, Optional<u32> status_code)> error_callback)
|
||||
{
|
||||
Core::EventLoop loop;
|
||||
|
||||
load(
|
||||
url,
|
||||
request,
|
||||
[&](auto data, auto& response_headers, auto status_code) {
|
||||
success_callback(data, response_headers, status_code);
|
||||
loop.quit(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue