
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
28 lines
617 B
C++
28 lines
617 B
C++
/*
|
|
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "LoadRequest.h"
|
|
#include <LibWeb/Cookie/Cookie.h>
|
|
#include <LibWeb/Page/Page.h>
|
|
|
|
namespace Web {
|
|
|
|
LoadRequest LoadRequest::create_for_url_on_page(const AK::URL& url, Page* page)
|
|
{
|
|
LoadRequest request;
|
|
request.set_url(url);
|
|
|
|
if (page) {
|
|
DeprecatedString cookie = page->client().page_did_request_cookie(url, Cookie::Source::Http);
|
|
if (!cookie.is_empty())
|
|
request.set_header("Cookie", cookie);
|
|
request.set_page(*page);
|
|
}
|
|
|
|
return request;
|
|
}
|
|
|
|
}
|