bneradt commented on code in PR #12572:
URL: https://github.com/apache/trafficserver/pull/12572#discussion_r2452625624
##########
plugins/experimental/access_control/pattern.cc:
##########
@@ -214,22 +195,13 @@ Pattern::process(const String &subject, StringVector
&result)
bool
Pattern::match(const String &subject)
{
- int matchCount;
AccessControlDebug("matching '%s' to '%s'", _pattern.c_str(),
subject.c_str());
- if (!_re) {
- return false;
- }
-
- matchCount = pcre_exec(_re, _extra, subject.c_str(), subject.length(), 0,
PCRE_NOTEMPTY, nullptr, 0);
- if (matchCount < 0) {
- if (matchCount != PCRE_ERROR_NOMATCH) {
- AccessControlError("matching error %d", matchCount);
- }
+ if (!_re || _re->empty()) {
return false;
}
- return true;
+ return _re->exec(subject);
Review Comment:
Oh, I see. That "default" doesn't mean that NOTEMPTY is default, but is
explaining that without the NOTEMPTY flag, empty strings will be matched.
Thanks for catching this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]