getRequestTarget())['path'] ?? ""; if (!in_array($target, ["/version", "/healthcheck"])) { return HTTP::respEmpty(404); } $method = $req->getMethod(); if ($method === "OPTIONS") { return HTTP::respEmpty(204, ['Allow' => "HEAD, GET"]); } elseif ($method !== "GET") { return HTTP::respEmpty(405, ['Allow' => "HEAD, GET"]); } $out = ""; if ($target === "/version") { $out = V1::VERSION; } elseif ($target === "/healthcheck") { $out = "OK"; } return new TextResponse($out); } }