Skip to content

Commit f03ba8c

Browse files
committed
[grid] Returning se:bidi when the user sends webSocketUrl.
Fixes #12314
1 parent a9ef96e commit f03ba8c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

java/src/org/openqa/selenium/grid/node/local/LocalNode.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,11 @@ private Session createExternalSession(
791791
toUse = new PersistentCapabilities(cdpFiltered).setCapability("se:cdpEnabled", false);
792792
}
793793

794+
// Check if the user wants to use BiDi
795+
boolean webSocketUrl = toUse.asMap().containsKey("webSocketUrl");
794796
// Add se:bidi if necessary to send the bidi url back
795-
if ((isSupportingBiDi || toUse.getCapability("se:bidi") != null) && bidiEnabled) {
797+
boolean bidiSupported = isSupportingBiDi || toUse.getCapability("se:bidi") != null;
798+
if (bidiSupported && bidiEnabled && webSocketUrl) {
796799
String bidiPath = String.format("/session/%s/se/bidi", other.getId());
797800
toUse = new PersistentCapabilities(toUse).setCapability("se:bidi", rewrite(bidiPath));
798801
} else {

0 commit comments

Comments
 (0)