MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / execute

Method execute

java/src/org/openqa/selenium/grid/web/NoHandler.java:44–66  ·  view source on GitHub ↗
(HttpRequest req)

Source from the content-addressed store, hash-verified

42 }
43
44 @Override
45 public HttpResponse execute(HttpRequest req) throws UncheckedIOException {
46 // We're not using ImmutableMap for the outer map because it disallows null values.
47 Map<String, @Nullable Object> responseMap = new HashMap<>();
48 responseMap.put("sessionId", null);
49 responseMap.put(
50 "value",
51 Map.of(
52 "error", "unknown command",
53 "message",
54 String.format(
55 "Unable to find command matching %s to %s", req.getMethod(), req.getUri()),
56 "stacktrace", ""));
57 responseMap = Collections.unmodifiableMap(responseMap);
58
59 byte[] payload = json.toJson(responseMap).getBytes(UTF_8);
60
61 return new HttpResponse()
62 .setStatus(HTTP_NOT_FOUND)
63 .setHeader("Content-Type", JSON_UTF_8.toString())
64 .setHeader("Content-Length", String.valueOf(payload.length))
65 .setContent(bytes(payload));
66 }
67}

Callers

nothing calls this directly

Calls 11

setContentMethod · 0.80
setHeaderMethod · 0.80
putMethod · 0.65
getUriMethod · 0.65
toJsonMethod · 0.65
setStatusMethod · 0.65
toStringMethod · 0.65
ofMethod · 0.45
formatMethod · 0.45
getMethodMethod · 0.45
bytesMethod · 0.45

Tested by

no test coverage detected