Skip to content

Commit 9a68c87

Browse files
committed
[grid] Add spec compliance checks to the standalone and hub
1 parent 59a979e commit 9a68c87

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

java/server/src/org/openqa/selenium/grid/commands/Hub.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import org.openqa.selenium.remote.http.HttpClient;
4545
import org.openqa.selenium.remote.http.HttpHandler;
4646
import org.openqa.selenium.remote.http.HttpResponse;
47+
import org.openqa.selenium.remote.http.Routable;
4748
import org.openqa.selenium.remote.http.Route;
4849
import org.openqa.selenium.remote.tracing.Tracer;
4950

@@ -140,8 +141,8 @@ protected void execute(Config config) {
140141
};
141142

142143
HttpHandler httpHandler = combine(
143-
router,
144-
Route.prefix("/wd/hub").to(combine(router)),
144+
router.with(networkOptions.getSpecComplianceChecks()),
145+
Route.prefix("/wd/hub").to(combine(router.with(networkOptions.getSpecComplianceChecks()))),
145146
Route.post("/graphql").to(() -> graphqlHandler),
146147
Route.get("/readyz").to(() -> readinessCheck));
147148

java/server/src/org/openqa/selenium/grid/commands/Standalone.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import org.openqa.selenium.remote.http.HttpClient;
5050
import org.openqa.selenium.remote.http.HttpHandler;
5151
import org.openqa.selenium.remote.http.HttpResponse;
52+
import org.openqa.selenium.remote.http.Routable;
5253
import org.openqa.selenium.remote.http.Route;
5354
import org.openqa.selenium.remote.tracing.Tracer;
5455

@@ -139,7 +140,10 @@ protected void execute(Config config) {
139140
combinedHandler.addHandler(sessions);
140141
Distributor distributor = new LocalDistributor(tracer, bus, clientFactory, sessions, null);
141142
combinedHandler.addHandler(distributor);
142-
Router router = new Router(tracer, clientFactory, sessions, distributor);
143+
144+
Routable router = new Router(tracer, clientFactory, sessions, distributor)
145+
.with(networkOptions.getSpecComplianceChecks());
146+
143147
HttpHandler readinessCheck = req -> {
144148
boolean ready = sessions.isReady() && distributor.isReady() && bus.isReady();
145149
return new HttpResponse()

0 commit comments

Comments
 (0)