trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

Possibly forgotten parameter of `Matcher::test_reg` in `plugins/header_rewrite /matcher.h`

Open freak82 opened this issue 1 year ago • 0 comments

Hi there,

There is this function and it has the following signature:

bool
test_reg(const std::string &t, bool nocase = false) const

However, it seems to me that the nocase parameter is forgotten and should be removed. Here are my thoughts/reasons for this:

  1. The Matcher class already takes nocase flag upon construction and stores it in a member variable. This same member variable is used in this function and in other functions of the class
  2. This test_reg function is private and it's part of overload set of test_reg functions which are called by the public test function of the Matcher. There nocase argument is not passed.
  3. The nocase argument is not used inside this test_reg function. It uses the _nocase member for debug printing, though.

So, should the nocase argument of this function be removed? Or should it be used in this function instead of _nocase member?

freak82 avatar May 21 '24 09:05 freak82