LibWeb: Avoid using JsonParser directly in WebDriver

No need to construct a temporary parser.
This commit is contained in:
Timothy Flynn 2025-03-19 17:46:08 -04:00 committed by Jelle Raaijmakers
parent 9214322129
commit 64aaf73775
Notes: github-actions[bot] 2025-03-20 09:51:30 +00:00

View file

@ -12,7 +12,6 @@
#include <AK/Debug.h>
#include <AK/Format.h>
#include <AK/JsonObject.h>
#include <AK/JsonParser.h>
#include <AK/JsonValue.h>
#include <AK/Span.h>
#include <AK/StringBuilder.h>
@ -258,8 +257,7 @@ ErrorOr<JsonValue, Client::WrappedError> Client::read_body_as_json(HTTP::HttpReq
if (content_length == 0)
return JsonValue {};
JsonParser json_parser(request.body());
return TRY(json_parser.parse());
return TRY(JsonValue::from_string(request.body()));
}
ErrorOr<void, Client::WrappedError> Client::handle_request(HTTP::HttpRequest const& request, JsonValue body)