code: private boolean headerContainsToken(Request request, String headerName, String target) {
          Enumeration<String> headers = request.getHeaders(headerName);
          while (headers.hasMoreElements()) {
              String header = headers.nextElement();
              String[] tokens = header.split(",");
              for (String token : tokens) {
                  if (target.equalsIgnoreCase(token.trim())) {
                      return true;
                  }
              }
          }
  
          return false;
      }
docs: /*
  This only works for tokens. Quoted strings need more sophisticated parsing.