Skip to content

Commit a5dc77b

Browse files
committed
Remove OPTIONS from HttpMethod
The underlying functionality is handled by the Netty server, so our servers should never see this requests. Tested locally by firing up the standalone server and using GraphiQL to poke the `/graphql` endpoint.
1 parent 72bb31c commit a5dc77b

5 files changed

Lines changed: 0 additions & 15 deletions

File tree

java/client/src/org/openqa/selenium/remote/http/HttpMethod.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ public enum HttpMethod {
2121
DELETE,
2222
GET,
2323
POST,
24-
OPTIONS,
2524
}

java/client/src/org/openqa/selenium/remote/http/Route.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import static org.openqa.selenium.remote.http.Contents.utf8String;
3636
import static org.openqa.selenium.remote.http.HttpMethod.DELETE;
3737
import static org.openqa.selenium.remote.http.HttpMethod.GET;
38-
import static org.openqa.selenium.remote.http.HttpMethod.OPTIONS;
3938
import static org.openqa.selenium.remote.http.HttpMethod.POST;
4039
import static org.openqa.selenium.remote.http.UrlPath.ROUTE_PREFIX_KEY;
4140

@@ -112,14 +111,6 @@ public static TemplatizedRouteConfig post(String template) {
112111
urlTemplate);
113112
}
114113

115-
public static TemplatizedRouteConfig options(String template) {
116-
UrlTemplate urlTemplate = new UrlTemplate(Require.nonNull("URL Template", template));
117-
118-
return new TemplatizedRouteConfig(
119-
new MatchesHttpMethod(OPTIONS).and(new MatchesTemplate(urlTemplate)),
120-
urlTemplate);
121-
}
122-
123114
public static NestedRouteConfig prefix(String prefix) {
124115
Require.nonNull("Prefix", prefix);
125116
Require.stateCondition(!prefix.isEmpty(), "Prefix to use must not be of 0 length");

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ protected void execute(Config config) {
143143
HttpHandler httpHandler = combine(
144144
router.with(networkOptions.getSpecComplianceChecks()),
145145
Route.prefix("/wd/hub").to(combine(router.with(networkOptions.getSpecComplianceChecks()))),
146-
Route.options("/graphql").to(() -> graphqlHandler),
147146
Route.post("/graphql").to(() -> graphqlHandler),
148147
Route.get("/readyz").to(() -> readinessCheck));
149148

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ protected void execute(Config config) {
156156
HttpHandler httpHandler = combine(
157157
router,
158158
Route.prefix("/wd/hub").to(combine(router)),
159-
Route.options("/graphql").to(() -> graphqlHandler),
160159
Route.post("/graphql").to(() -> graphqlHandler),
161160
Route.get("/readyz").to(() -> readinessCheck));
162161

java/server/src/org/openqa/selenium/grid/graphql/GraphqlHandler.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ public GraphqlHandler(Distributor distributor, URI publicUri) {
8888

8989
@Override
9090
public HttpResponse execute(HttpRequest req) throws UncheckedIOException {
91-
if (req.getMethod() == HttpMethod.OPTIONS) {
92-
return new HttpResponse().setStatus(HTTP_OK);
93-
}
9491
Map<String, Object> inputs = JSON.toType(Contents.string(req), MAP_TYPE);
9592

9693
if (!(inputs.get("query") instanceof String)) {

0 commit comments

Comments
 (0)