@@ -17,71 +17,70 @@ headers, moving forward we should find a way in upstream to provide
17
17
access to these headers for loader clients created on the browser process.
18
18
19
19
diff --git a/services/network/public/cpp/resource_request.cc b/services/network/public/cpp/resource_request.cc
20
- index 4e698635af5ac40fddfb2cf46b01be01e7a7e7cd..a9a92de4b9d5c67474d8bd98304f56b72d648666 100644
20
+ index 3d4cc0dbf277edd29cb2dddbd5cb37b6b5fa4c26..ea85b63e87ee38619dedf609c0b95c39698c7657 100644
21
21
--- a/services/network/public/cpp/resource_request.cc
22
22
+++ b/services/network/public/cpp/resource_request.cc
23
- @@ -153,6 +153,7 @@ ResourceRequest::TrustedParams& ResourceRequest::TrustedParams::operator=(
24
- disable_secure_dns = other.disable_secure_dns;
25
- has_user_activation = other.has_user_activation;
23
+ @@ -155,6 +155,7 @@ ResourceRequest::TrustedParams& ResourceRequest::TrustedParams::operator=(
26
24
allow_cookies_from_browser = other.allow_cookies_from_browser;
25
+ include_request_cookies_with_response =
26
+ other.include_request_cookies_with_response;
27
27
+ report_raw_headers = other.report_raw_headers;
28
28
cookie_observer =
29
29
Clone(&const_cast<mojo::PendingRemote<mojom::CookieAccessObserver>&>(
30
30
other.cookie_observer));
31
- @@ -183 ,6 +184 ,7 @@ bool ResourceRequest::TrustedParams::EqualsForTesting(
31
+ @@ -185 ,6 +186 ,7 @@ bool ResourceRequest::TrustedParams::EqualsForTesting(
32
32
const TrustedParams& other) const {
33
33
return isolation_info.IsEqualForTesting(other.isolation_info) &&
34
34
disable_secure_dns == other.disable_secure_dns &&
35
35
+ report_raw_headers == other.report_raw_headers &&
36
36
has_user_activation == other.has_user_activation &&
37
37
allow_cookies_from_browser == other.allow_cookies_from_browser &&
38
- client_security_state == other.client_security_state;
38
+ include_request_cookies_with_response ==
39
39
diff --git a/services/network/public/cpp/resource_request.h b/services/network/public/cpp/resource_request.h
40
- index 44ad1e89f20263b180f0a2c0388e9ef036875593..1d61b5c9008b47db9623c731ef6d5f70f8dd534b 100644
40
+ index 7e84c5373d432512a7543430db49022b5f89cc99..1df3a8c178981391856c611e5a78c7d9d1e2c5bd 100644
41
41
--- a/services/network/public/cpp/resource_request.h
42
42
+++ b/services/network/public/cpp/resource_request.h
43
- @@ -72,6 +72,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
44
- bool disable_secure_dns = false;
43
+ @@ -73,6 +73,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
45
44
bool has_user_activation = false;
46
45
bool allow_cookies_from_browser = false;
46
+ bool include_request_cookies_with_response = false;
47
47
+ bool report_raw_headers = false;
48
48
mojo::PendingRemote<mojom::CookieAccessObserver> cookie_observer;
49
49
mojo::PendingRemote<mojom::TrustTokenAccessObserver> trust_token_observer;
50
50
mojo::PendingRemote<mojom::URLLoaderNetworkServiceObserver>
51
51
diff --git a/services/network/public/cpp/url_request_mojom_traits.cc b/services/network/public/cpp/url_request_mojom_traits.cc
52
- index aa3d03142152af6e3ce8d0eafa8193221dac8687..bea0ddcdf60f249a0fe57ff7ec8f37b1ee4c3d69 100644
52
+ index d147b20dfea8928f9d5fded8037cf4f873d5b8e9..a7cbff37d1ebfd6b2ba8b248282e0dd50b95e63e 100644
53
53
--- a/services/network/public/cpp/url_request_mojom_traits.cc
54
54
+++ b/services/network/public/cpp/url_request_mojom_traits.cc
55
- @@ -93,6 +93,7 @@ bool StructTraits<network::mojom::TrustedUrlRequestParamsDataView,
56
- out->disable_secure_dns = data.disable_secure_dns();
57
- out->has_user_activation = data.has_user_activation();
55
+ @@ -95,6 +95,7 @@ bool StructTraits<network::mojom::TrustedUrlRequestParamsDataView,
58
56
out->allow_cookies_from_browser = data.allow_cookies_from_browser();
57
+ out->include_request_cookies_with_response =
58
+ data.include_request_cookies_with_response();
59
59
+ out->report_raw_headers = data.report_raw_headers();
60
60
out->cookie_observer = data.TakeCookieObserver<
61
61
mojo::PendingRemote<network::mojom::CookieAccessObserver>>();
62
62
out->trust_token_observer = data.TakeTrustTokenObserver<
63
63
diff --git a/services/network/public/cpp/url_request_mojom_traits.h b/services/network/public/cpp/url_request_mojom_traits.h
64
- index 1dadf5b4cac21033b096757f1bb52e0d74966a54..d52d6e48d70bf162c5022cc991c2371d1482f4bc 100644
64
+ index 32218c469a135fe903b8fc02d6388258e144bd03..86b824dd3345bb812a24621d4b27bda7b9c07630 100644
65
65
--- a/services/network/public/cpp/url_request_mojom_traits.h
66
66
+++ b/services/network/public/cpp/url_request_mojom_traits.h
67
- @@ -73,6 +73,10 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
67
+ @@ -76,6 +76,9 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
68
+ static bool include_request_cookies_with_response(
68
69
const network::ResourceRequest::TrustedParams& trusted_params) {
69
- return trusted_params.allow_cookies_from_browser;
70
- }
70
+ return trusted_params.include_request_cookies_with_response;
71
71
+ static bool report_raw_headers(
72
72
+ const network::ResourceRequest::TrustedParams& trusted_params) {
73
73
+ return trusted_params.report_raw_headers;
74
- + }
74
+ }
75
75
static mojo::PendingRemote<network::mojom::CookieAccessObserver>
76
76
cookie_observer(
77
- const network::ResourceRequest::TrustedParams& trusted_params) {
78
77
diff --git a/services/network/public/mojom/url_request.mojom b/services/network/public/mojom/url_request.mojom
79
- index 15942d6eceaa9c3ef565d35cc8e08633ea4d66b0..4622e39e0791e024ff9bfd49e8ca5fe7e1f92184 100644
78
+ index 1d510b64f480ba516009cb1d995fbe9ca29ec164..d6d17abbb058c2e4109ab98a3db1bdf7734ba4c9 100644
80
79
--- a/services/network/public/mojom/url_request.mojom
81
80
+++ b/services/network/public/mojom/url_request.mojom
82
- @@ -74 ,6 +74 ,9 @@ struct TrustedUrlRequestParams {
83
- // FollowRedirect() .
84
- bool allow_cookies_from_browser ;
81
+ @@ -80 ,6 +80 ,9 @@ struct TrustedUrlRequestParams {
82
+ // client which should not be able to see them .
83
+ bool include_request_cookies_with_response = false ;
85
84
86
85
+ // [Electron] Whether to provide unfiltered response headers.
87
86
+ bool report_raw_headers;
@@ -90,18 +89,18 @@ index 15942d6eceaa9c3ef565d35cc8e08633ea4d66b0..4622e39e0791e024ff9bfd49e8ca5fe7
90
89
// a cookie. If this is set to non-null, the observer passed to
91
90
// URLLoaderFactory will be ignored.
92
91
diff --git a/services/network/public/mojom/url_response_head.mojom b/services/network/public/mojom/url_response_head.mojom
93
- index 20c923eeca30aeba71f97a2d45ccec8a65986325..1f8fa3705e67abbe665062bad8ed97d48717d3cc 100644
92
+ index 64ec7b5a4bfb08a2bbd75ce03a602b36e6b0f278..f726e1ccf33dee59a131f881fa000f506a772e65 100644
94
93
--- a/services/network/public/mojom/url_response_head.mojom
95
94
+++ b/services/network/public/mojom/url_response_head.mojom
96
- @@ -12,6 +12,7 @@ import "services/network/public/mojom/encoded_body_length.mojom";
97
- import "services/network/public/mojom/attribution.mojom";
95
+ @@ -13,6 +13,7 @@ import "services/network/public/mojom/attribution.mojom";
98
96
import "services/network/public/mojom/fetch_api.mojom";
97
+ import "services/network/public/mojom/http_request_headers.mojom";
99
98
import "services/network/public/mojom/ip_address_space.mojom";
100
99
+ import "services/network/public/mojom/http_raw_headers.mojom";
101
100
import "services/network/public/mojom/ip_endpoint.mojom";
102
101
import "services/network/public/mojom/load_timing_info.mojom";
103
102
import "services/network/public/mojom/network_param.mojom";
104
- @@ -42 ,6 +43 ,9 @@ struct URLResponseHead {
103
+ @@ -44 ,6 +45 ,9 @@ struct URLResponseHead {
105
104
// The response headers or NULL if the URL type does not support headers.
106
105
HttpResponseHeaders headers;
107
106
@@ -112,18 +111,18 @@ index 20c923eeca30aeba71f97a2d45ccec8a65986325..1f8fa3705e67abbe665062bad8ed97d4
112
111
string mime_type;
113
112
114
113
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
115
- index 11d8e6c2d2917edab70486983f24952f510f6999..95c7d4a18290f8a02fe3d86b86a0ce9ed3ff71ae 100644
114
+ index 451d4025f7bbdccd27842d61e11d631ae2fd5894..8ea2281668c77631e47ddfee64b82c020c2cf2f9 100644
116
115
--- a/services/network/url_loader.cc
117
116
+++ b/services/network/url_loader.cc
118
- @@ -705,6 +705,7 @@ URLLoader::URLLoader(
119
- has_user_activation_ = request.trusted_params->has_user_activation;
120
- allow_cookies_from_browser_ =
117
+ @@ -707,6 +707,7 @@ URLLoader::URLLoader(
121
118
request.trusted_params->allow_cookies_from_browser;
119
+ include_request_cookies_with_response_ =
120
+ request.trusted_params->include_request_cookies_with_response;
122
121
+ report_raw_headers_ = request.trusted_params->report_raw_headers;
123
122
}
124
123
125
124
// Store any cookies passed from the browser process to later attach them to
126
- @@ -743 ,7 +744 ,7 @@ URLLoader::URLLoader(
125
+ @@ -745 ,7 +746 ,7 @@ URLLoader::URLLoader(
127
126
&URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this)));
128
127
}
129
128
@@ -132,7 +131,7 @@ index 11d8e6c2d2917edab70486983f24952f510f6999..95c7d4a18290f8a02fe3d86b86a0ce9e
132
131
url_request_->SetResponseHeadersCallback(base::BindRepeating(
133
132
&URLLoader::SetRawResponseHeaders, base::Unretained(this)));
134
133
}
135
- @@ -1682 ,6 +1683 ,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
134
+ @@ -1690 ,6 +1691 ,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
136
135
}
137
136
138
137
response_ = BuildResponseHead();
@@ -153,10 +152,10 @@ index 11d8e6c2d2917edab70486983f24952f510f6999..95c7d4a18290f8a02fe3d86b86a0ce9e
153
152
154
153
// Parse and remove the Trust Tokens response headers, if any are expected,
155
154
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
156
- index 946af13aec973a4650ffaf13cd35e31524199e65..bf8bdae3c88f455edf68c6d20c6377ca8aae3d8e 100644
155
+ index d4d72e186dc16d73ee0beabff89a7875bd91da03..068ced0a8d72bf8a4179b88dfab1a5377307fc6c 100644
157
156
--- a/services/network/url_loader.h
158
157
+++ b/services/network/url_loader.h
159
- @@ -656 ,6 +656 ,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
158
+ @@ -657 ,6 +657 ,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
160
159
std::unique_ptr<ResourceScheduler::ScheduledResourceRequest>
161
160
resource_scheduler_request_handle_;
162
161
0 commit comments