Change whitelist behavior so it is more likely what the user wants.

This commit is contained in:
Jacob Dufault 2017-10-24 18:09:02 -07:00
parent 58f2107714
commit 93d3b2b3cb

View File

@ -61,11 +61,8 @@ GroupMatch::GroupMatch(const std::vector<std::string>& whitelist,
bool GroupMatch::IsMatch(const std::string& value, bool GroupMatch::IsMatch(const std::string& value,
std::string* match_failure_reason) const { std::string* match_failure_reason) const {
for (const Matcher& m : whitelist) { for (const Matcher& m : whitelist) {
if (!m.IsMatch(value)) { if (m.IsMatch(value))
if (match_failure_reason) return true;
*match_failure_reason = "whitelist \"" + m.regex_string + "\"";
return false;
}
} }
for (const Matcher& m : blacklist) { for (const Matcher& m : blacklist) {