docs: protected boolean urlPatternMatch(String pattern1, String pattern2) {
          if (pattern1.equals(pattern2)) {
              return true;
          }
          if (pattern1.equals("/*")) {
              return true;
          }
          if (pattern1.startsWith("/") && pattern1.endsWith("/*")) {
              String subPattern = pattern1.substring(0, pattern1.length() - 2);
              int pLength = subPattern.length();
              if (pattern2.startsWith(subPattern)) {
                  if (pattern2.length() == pLength || pattern2.charAt(pLength) == '/') {
                      return true;
                  }
              }
          }
  
          if (pattern1.startsWith("*.")) {
              if (pattern2.endsWith(pattern1.substring(1))) {
                  return true;
              }
          }
  
          if (pattern1.equals("/")) {
              return true;
          }
          return false;
      }