Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Expose remote IP and port in webRequest details
Browse files Browse the repository at this point in the history
Needed for session.webRequest.onHeadersReceived in order to implement brave/browser-laptop#12671
  • Loading branch information
diracdeltas committed Jan 23, 2018
1 parent db51c41 commit ac866b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions atom/browser/net/atom_network_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ void ToDictionary(base::DictionaryValue* details, net::URLRequest* request) {
details->SetString("resourceType",
info ? ResourceTypeToString(info->GetResourceType())
: "other");
net::IPEndPoint request_ip_endpoint;
bool was_successful = request->GetRemoteEndpoint(&request_ip_endpoint);
if (was_successful) {
details->SetString("ip", request_ip_endpoint.ToStringWithoutPort());
details->SetInteger("port", request_ip_endpoint.port());
}
}

void ToDictionary(base::DictionaryValue* details,
Expand Down

0 comments on commit ac866b5

Please sign in to comment.