code: protected void doFilterImpl(ServletRequest pRequest, ServletResponse pResponse, FilterChain pChain) throws IOException, ServletException {
          // NOTE: super invokes trigger() and image specific doFilter() if needed
          super.doFilterImpl(pRequest, pResponse, pChain);
  
          if (pResponse instanceof HttpServletResponse) {
              // Update the Vary HTTP header field
              ((HttpServletResponse) pResponse).addHeader(HTTP_HEADER_VARY, HTTP_HEADER_ACCEPT);
              //((HttpServletResponse) pResponse).addHeader(HTTP_HEADER_VARY, HTTP_HEADER_USER_AGENT);
          }
      }
docs: /*
  public void setAcceptMappings(String pPropertiesFile) {
  NOTE: Supposed to be:
  <agent-name>=<reg-exp>
  <agent-name>.accept=<http-accept-header>
  
  Properties mappings = new Properties();
  try {
  mappings.load(getServletContext().getResourceAsStream(pPropertiesFile));
  
  List patterns = new ArrayList();
  List accepts = new ArrayList();
  
  for (Iterator iterator = mappings.keySet().iterator(); iterator.hasNext();) {
  String agent = (String) iterator.next();
  if (agent.endsWith(".accept")) {
  continue;
  }
  
  try {
  patterns.add(Pattern.compile((String) mappings.get(agent)));
  
  TODO: Consider preparsing ACCEPT header??
  accepts.add(mappings.get(agent + ".accept"));
  }
  catch (PatternSyntaxException e) {
  log("Could not parse User-Agent identification for " + agent, e);
  }
  
  mKnownAgentPatterns = (Pattern[]) patterns.toArray(new Pattern[patterns.size()]);
  mKnownAgentAccpets = (String[]) accepts.toArray(new String[accepts.size()]);
  }
  }
  catch (IOException e) {
  log("Could not read accetp-mappings properties file: " + pPropertiesFile, e);
  }
  }