Skip to content

Commit

Permalink
[Grid] Changing host header before forwarding commands to the driver
Browse files Browse the repository at this point in the history
Fixes #8326 and fixes #7821
ChromeDriver will reject requests if the host header contains something different
than localhost and no whitelistedIps are configured.
This does not affect other drivers.
  • Loading branch information
diemol committed May 26, 2020
1 parent f10105c commit f2a7e5e
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -61,6 +61,9 @@ protected ProtocolConvertingSession(

@Override
public HttpResponse execute(HttpRequest req) {
String host = "host";
req.removeHeader(host);
req.addHeader(host, String.format("%s:%s", getUri().getHost(), getUri().getPort()));
HttpResponse res = handler.execute(req);
if (req.getMethod() == DELETE && killUrl.equals(req.getUri())) {
stop();
Expand Down

0 comments on commit f2a7e5e

Please sign in to comment.