Skip to content

Commit

Permalink
Format and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Anilm3 committed Sep 12, 2024
1 parent 3863d0b commit 574fc85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/parser/matcher_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "matcher/regex_match.hpp"
#include "parameter.hpp"
#include "parser/common.hpp"
#include "parser/matcher_parser.hpp"
#include "parser/matcher_parser.hpp" // IWYU pragma: keep

namespace ddwaf::parser::v2 {

Expand All @@ -39,7 +39,6 @@ std::pair<std::string, std::unique_ptr<matcher::base>> parse_matcher<matcher::ph
const parameter::map &params)
{
parameter::map options;
std::unique_ptr<matcher::base> matcher;

auto list = at<parameter::vector>(params, "list");
options = at<parameter::map>(params, "options", options);
Expand Down Expand Up @@ -69,7 +68,6 @@ std::pair<std::string, std::unique_ptr<matcher::base>> parse_matcher<matcher::re
const parameter::map &params)
{
parameter::map options;
std::unique_ptr<matcher::base> matcher;

auto regex = at<std::string>(params, "regex");
options = at<parameter::map>(params, "options", options);
Expand Down
7 changes: 4 additions & 3 deletions src/parser/matcher_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace ddwaf::parser::v2 {

template <typename Matcher>
std::pair<std::string, std::unique_ptr<matcher::base>> parse_matcher(const parameter::map &params);

template <typename Matcher, typename... Rest>
std::pair<std::string, std::unique_ptr<matcher::base>> parse_matcher(
std::string_view name, const parameter::map &params)
Expand All @@ -45,8 +45,9 @@ std::pair<std::string, std::unique_ptr<matcher::base>> parse_matcher(
inline std::pair<std::string, std::unique_ptr<matcher::base>> parse_any_matcher(
std::string_view name, const parameter::map &params)
{
return parse_matcher<
matcher::equals<>, matcher::exact_match, matcher::greater_than<>, matcher::ip_match, matcher::is_sqli, matcher::is_xss, matcher::lower_than<>, matcher::phrase_match, matcher::regex_match>(name, params);
return parse_matcher<matcher::equals<>, matcher::exact_match, matcher::greater_than<>,
matcher::ip_match, matcher::is_sqli, matcher::is_xss, matcher::lower_than<>,
matcher::phrase_match, matcher::regex_match>(name, params);
}

} // namespace ddwaf::parser::v2

0 comments on commit 574fc85

Please sign in to comment.