1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

Ladybird: Update for AK::{String => DeprecatedString} rename

This commit is contained in:
Linus Groh 2022-12-04 18:43:54 +00:00 committed by Andrew Kaster
parent 97dd5a085f
commit 5a5c4f079b
29 changed files with 172 additions and 172 deletions

View file

@ -22,7 +22,7 @@ void RequestManagerQt::reply_finished(QNetworkReply* reply)
request->did_finish();
}
RefPtr<Web::ResourceLoaderConnectorRequest> RequestManagerQt::start_request(String const& method, AK::URL const& url, HashMap<String, String> const& request_headers, ReadonlyBytes request_body, Core::ProxyData const& proxy)
RefPtr<Web::ResourceLoaderConnectorRequest> RequestManagerQt::start_request(DeprecatedString const& method, AK::URL const& url, HashMap<DeprecatedString, DeprecatedString> const& request_headers, ReadonlyBytes request_body, Core::ProxyData const& proxy)
{
if (!url.scheme().is_one_of_ignoring_case("http"sv, "https"sv)) {
return nullptr;
@ -36,9 +36,9 @@ RefPtr<Web::ResourceLoaderConnectorRequest> RequestManagerQt::start_request(Stri
return request;
}
ErrorOr<NonnullRefPtr<RequestManagerQt::Request>> RequestManagerQt::Request::create(QNetworkAccessManager& qnam, String const& method, AK::URL const& url, HashMap<String, String> const& request_headers, ReadonlyBytes request_body, Core::ProxyData const&)
ErrorOr<NonnullRefPtr<RequestManagerQt::Request>> RequestManagerQt::Request::create(QNetworkAccessManager& qnam, DeprecatedString const& method, AK::URL const& url, HashMap<DeprecatedString, DeprecatedString> const& request_headers, ReadonlyBytes request_body, Core::ProxyData const&)
{
QNetworkRequest request { QString(url.to_string().characters()) };
QNetworkRequest request { QString(url.to_deprecated_string().characters()) };
request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::ManualRedirectPolicy);
request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
@ -79,11 +79,11 @@ void RequestManagerQt::Request::did_finish()
bool success = m_reply.error() == QNetworkReply::NetworkError::NoError;
auto buffer = m_reply.readAll();
auto http_status_code = m_reply.attribute(QNetworkRequest::Attribute::HttpStatusCodeAttribute).toInt();
HashMap<String, String, CaseInsensitiveStringTraits> response_headers;
Vector<String> set_cookie_headers;
HashMap<DeprecatedString, DeprecatedString, CaseInsensitiveStringTraits> response_headers;
Vector<DeprecatedString> set_cookie_headers;
for (auto& it : m_reply.rawHeaderPairs()) {
auto name = String(it.first.data(), it.first.length());
auto value = String(it.second.data(), it.second.length());
auto name = DeprecatedString(it.first.data(), it.first.length());
auto value = DeprecatedString(it.second.data(), it.second.length());
if (name.equals_ignoring_case("set-cookie"sv)) {
// NOTE: Qt may have bundled multiple Set-Cookie headers into a single one.
// We have to extract the full list of cookies via QNetworkReply::header().
@ -96,7 +96,7 @@ void RequestManagerQt::Request::did_finish()
}
}
if (!set_cookie_headers.is_empty()) {
response_headers.set("set-cookie"sv, JsonArray { set_cookie_headers }.to_string());
response_headers.set("set-cookie"sv, JsonArray { set_cookie_headers }.to_deprecated_string());
}
on_buffered_request_finish(success, buffer.length(), response_headers, http_status_code, ReadonlyBytes { buffer.data(), (size_t)buffer.size() });
}