Skip to content

Commit cb71ab3

Browse files
author
Wojciech Krol
authored
fix: Backported fix to notify chromium of redirect inside intercepted protocol (electron#23997)
1 parent 3e6ee02 commit cb71ab3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

shell/browser/net/atom_url_loader_factory.cc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,19 @@ void AtomURLLoaderFactory::StartLoading(
230230
std::string location;
231231
if (head.headers->IsRedirect(&location)) {
232232
network::ResourceRequest new_request = request;
233-
new_request.url = GURL(location);
233+
GURL new_location = GURL(location);
234+
235+
new_request.url = new_location;
236+
new_request.site_for_cookies = new_location;
237+
238+
net::RedirectInfo redirect_info;
239+
redirect_info.status_code = head.headers->response_code();
240+
redirect_info.new_method = request.method;
241+
redirect_info.new_url = new_location;
242+
redirect_info.new_site_for_cookies = new_location;
243+
244+
client->OnReceiveRedirect(redirect_info, head);
245+
234246
// When the redirection comes from an intercepted scheme (which has
235247
// |proxy_factory| passed), we askes the proxy factory to create a loader
236248
// for new URL, otherwise we call |StartLoadingHttp|, which creates

0 commit comments

Comments
 (0)