Skip to content

Commit

Permalink
Refactor HTML and JSON parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
royshil committed Oct 28, 2024
1 parent 6238697 commit 377825b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/parsers/html.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ struct request_data_handler_response parse_html(struct request_data_handler_resp
}
return make_fail_parse_response(std::string("HTML parsing exception: ") + e.what());
}
}
}
2 changes: 2 additions & 0 deletions src/parsers/jsonpath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
#include <jsoncons/basic_json.hpp>
#include <jsoncons_ext/jsonpath/jsonpath.hpp>
#include <nlohmann/json.hpp>
#include <util/c99defs.h>

struct request_data_handler_response parse_json(struct request_data_handler_response response,
const url_source_request_data *request_data)
{
UNUSED_PARAMETER(request_data);
try {
// Parse JSON only once and store in both formats
auto json_cons = jsoncons::json::parse(response.body);
Expand Down

0 comments on commit 377825b

Please sign in to comment.