From a15d32982aeb2572833e80e55ddcb2c39a26859d Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 7 Oct 2022 17:17:21 +0100 Subject: [PATCH] WebDriver: Implement `GET /status` endpoint --- Userland/Services/WebDriver/Client.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Userland/Services/WebDriver/Client.cpp b/Userland/Services/WebDriver/Client.cpp index 31b9b017485..64df1232962 100644 --- a/Userland/Services/WebDriver/Client.cpp +++ b/Userland/Services/WebDriver/Client.cpp @@ -391,8 +391,18 @@ ErrorOr Client::handle_get_status(Vector, Json { dbgln_if(WEBDRIVER_DEBUG, "Handling GET /status"); - // FIXME: Implement the spec steps - return HttpError { 400, "", "" }; + // 1. Let body be a new JSON Object with the following properties: + // "ready" + // The remote end’s readiness state. + // "message" + // An implementation-defined string explaining the remote end’s readiness state. + // FIXME: Report if we are somehow not ready. + JsonObject body; + body.set("ready", true); + body.set("message", "Ready to start some sessions!"); + + // 2. Return success with data body. + return body; } // POST /session/{session id}/url https://w3c.github.io/webdriver/#dfn-navigate-to