mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibWeb: Avoid using JsonParser directly in WebDriver
No need to construct a temporary parser.
This commit is contained in:
parent
9214322129
commit
64aaf73775
Notes:
github-actions[bot]
2025-03-20 09:51:30 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/64aaf73775a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4008 Reviewed-by: https://github.com/gmta ✅
1 changed files with 1 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue