Files
brave-core/patches/services-network-oblivious_http_request_handler.cc.patch
Darnell Andries d4c72967f9 Extend OHTTP client to support relay headers and chunking (#36292)
* Extend OHTTP client to support relay headers and chunking

* Address PR feedback
2026-05-20 19:44:18 +01:00

37 lines
1.7 KiB
Diff

diff --git a/services/network/oblivious_http_request_handler.cc b/services/network/oblivious_http_request_handler.cc
index d143da451305d4c4fe520624f071042dbc79863d..e650747aa523ed30c1973da70d507462c7ea317e 100644
--- a/services/network/oblivious_http_request_handler.cc
+++ b/services/network/oblivious_http_request_handler.cc
@@ -160,6 +160,7 @@ scoped_refptr<net::HttpResponseHeaders> GetSyntheticBhttpResponseHeader(
class ObliviousHttpRequestHandler::RequestState {
public:
mojom::ObliviousHttpRequestPtr request;
+ BRAVE_OBLIVIOUS_HTTP_REQUEST_STATE_MEMBERS
std::unique_ptr<SimpleURLLoader> loader;
std::unique_ptr<TrustTokenRequestHelperFactory> trust_token_helper_factory;
std::unique_ptr<TrustTokenRequestHelper> trust_token_helper;
@@ -354,6 +355,7 @@ void ObliviousHttpRequestHandler::ContinueHandlingRequest(
}
// Encrypt
+ BRAVE_OBLIVIOUS_HTTP_MAYBE_ENCRYPT_AS_CHUNKED
auto maybe_client = StatefulObliviousHttpClient::CreateFromKeyConfig(
std::move(state->request->key_config));
if (!maybe_client) {
@@ -379,6 +381,7 @@ void ObliviousHttpRequestHandler::ContinueHandlingRequest(
resource_request->load_flags |= net::LOAD_DISABLE_CACHE;
resource_request->net_log_create_info = state->net_log.source();
+ BRAVE_OBLIVIOUS_HTTP_CONTINUE_HANDLING_REQUEST
state->loader = SimpleURLLoader::Create(
std::move(resource_request),
net::NetworkTrafficAnnotationTag(state->request->traffic_annotation));
@@ -450,6 +453,7 @@ void ObliviousHttpRequestHandler::OnRequestComplete(
return;
}
+ BRAVE_OBLIVIOUS_HTTP_MAYBE_NOTIFY_COMPLETE_FROM_CHUNKS
auto maybe_payload =
state->ohttp_client->DecryptResponse(std::move(response).value());
if (!maybe_payload) {