docs: protected static void parseRuleFlag(String line, RewriteRule rule, String flag) {
          if (flag.equals("chain") || flag.equals("C")) {
              rule.setChain(true);
          } else if (flag.startsWith("cookie=") || flag.startsWith("CO=")) {
              rule.setCookie(true);
              if (flag.startsWith("cookie")) {
                  flag = flag.substring("cookie=".length());
              } else if (flag.startsWith("CO=")) {
                  flag = flag.substring("CO=".length());
              }
              StringTokenizer tokenizer = new StringTokenizer(flag, ":");
              if (tokenizer.countTokens() < 2) {
                  throw UndertowServletLogger.ROOT_LOGGER.invalidRewriteFlags(line);
              }
              rule.setCookieName(tokenizer.nextToken());
              rule.setCookieValue(tokenizer.nextToken());
              if (tokenizer.hasMoreTokens()) {
                  rule.setCookieDomain(tokenizer.nextToken());
              }
              if (tokenizer.hasMoreTokens()) {
                  try {
                      rule.setCookieLifetime(Integer.parseInt(tokenizer.nextToken()));
                  } catch (NumberFormatException e) {
                      throw UndertowServletLogger.ROOT_LOGGER.invalidRewriteFlags(line);
                  }
              }
              if (tokenizer.hasMoreTokens()) {
                  rule.setCookiePath(tokenizer.nextToken());
              }
              if (tokenizer.hasMoreTokens()) {
                  rule.setCookieSecure(Boolean.parseBoolean(tokenizer.nextToken()));
              }
              if (tokenizer.hasMoreTokens()) {
                  rule.setCookieHttpOnly(Boolean.parseBoolean(tokenizer.nextToken()));
              }
          } else if (flag.startsWith("env=") || flag.startsWith("E=")) {
              rule.setEnv(true);
              if (flag.startsWith("env=")) {
                  flag = flag.substring("env=".length());
              } else if (flag.startsWith("E=")) {
                  flag = flag.substring("E=".length());
              }
              int pos = flag.indexOf(':');
              if (pos == -1 || (pos + 1) == flag.length()) {
                  throw UndertowServletLogger.ROOT_LOGGER.invalidRewriteFlags(line);
              }
              rule.addEnvName(flag.substring(0, pos));
              rule.addEnvValue(flag.substring(pos + 1));
          } else if (flag.startsWith("forbidden") || flag.startsWith("F")) {
              rule.setForbidden(true);
          } else if (flag.startsWith("gone") || flag.startsWith("G")) {
              rule.setGone(true);
          } else if (flag.startsWith("host") || flag.startsWith("H")) {
              rule.setHost(true);
          } else if (flag.startsWith("last") || flag.startsWith("L")) {
              rule.setLast(true);
          } else if (flag.startsWith("next") || flag.startsWith("N")) {
              rule.setNext(true);
          } else if (flag.startsWith("nocase") || flag.startsWith("NC")) {
              rule.setNocase(true);
          } else if (flag.startsWith("noescape") || flag.startsWith("NE")) {
              rule.setNoescape(true);
          /* Proxy not supported, would require strong proxy capabilities
          } else if (flag.startsWith("proxy") || flag.startsWith("P")) {
              rule.setProxy(true);*/
          } else if (flag.startsWith("qsappend") || flag.startsWith("QSA")) {
              rule.setQsappend(true);
          } else if (flag.startsWith("redirect") || flag.startsWith("R")) {
              if (flag.startsWith("redirect=")) {
                  flag = flag.substring("redirect=".length());
                  rule.setRedirect(true);
                  rule.setRedirectCode(Integer.parseInt(flag));
              } else if (flag.startsWith("R=")) {
                  flag = flag.substring("R=".length());
                  rule.setRedirect(true);
                  rule.setRedirectCode(Integer.parseInt(flag));
              } else {
                  rule.setRedirect(true);
                  rule.setRedirectCode(HttpServletResponse.SC_FOUND);
              }
          } else if (flag.startsWith("skip") || flag.startsWith("S")) {
              if (flag.startsWith("skip=")) {
                  flag = flag.substring("skip=".length());
              } else if (flag.startsWith("S=")) {
                  flag = flag.substring("S=".length());
              }
              rule.setSkip(Integer.parseInt(flag));
          } else if (flag.startsWith("type") || flag.startsWith("T")) {
              if (flag.startsWith("type=")) {
                  flag = flag.substring("type=".length());
              } else if (flag.startsWith("T=")) {
                  flag = flag.substring("T=".length());
              }
              rule.setType(true);
              rule.setTypeValue(flag);
          } else {
              throw UndertowServletLogger.ROOT_LOGGER.invalidRewriteFlags(line, flag);
          }
      }