Skip to content

Commit ae02d81

Browse files
committed
Grid Nodes can set firefox binary paths
This has been a bug since before 3.0 was released, and this now restores the original behaviour we had in 2.53.1. Of course, this behaviour is All Wrong, as it doesn't bother to update FirefoxOptions, and it should be the Node that performs this translation, not the Hub, but you win some, you lose some.
1 parent fe6383b commit ae02d81

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

java/server/src/org/openqa/grid/web/servlet/handler/RequestHandler.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.openqa.grid.web.servlet.handler;
1919

20+
import com.google.common.collect.ImmutableMap;
21+
2022
import org.openqa.grid.common.exception.ClientGoneException;
2123
import org.openqa.grid.common.exception.GridException;
2224
import org.openqa.grid.internal.ExternalSessionKey;
@@ -27,6 +29,7 @@
2729
import org.openqa.grid.internal.exception.NewSessionException;
2830
import org.openqa.grid.internal.listeners.TestSessionListener;
2931
import org.openqa.selenium.remote.DesiredCapabilities;
32+
import org.openqa.selenium.remote.NewSessionPayload;
3033

3134
import java.io.IOException;
3235
import java.net.SocketTimeoutException;
@@ -79,7 +82,11 @@ public RequestHandler(
7982
*/
8083
public void forwardNewSessionRequestAndUpdateRegistry(TestSession session)
8184
throws NewSessionException {
82-
try {
85+
try (NewSessionPayload payload = NewSessionPayload.create(
86+
ImmutableMap.of("desiredCapabilities", session.getRequestedCapabilities()))) {
87+
StringBuilder json = new StringBuilder();
88+
payload.writeTo(json);
89+
request.setBody(payload.toString());
8390
session.forward(getRequest(), getResponse(), true);
8491
} catch (IOException e) {
8592
//log.warning("Error forwarding the request " + e.getMessage());

0 commit comments

Comments
 (0)