title: How can I eliminate duplicate Date headers when using Jetty and Apache CXF?
body: <p>I am working on a legacy application which runs as an embedded Jetty server. The very first code that is called is:</p>
  
  <pre><code>Server server = new Server();
  server.setSendDateHeader(true);
  </code></pre>
  
  <p>Next some contexts are created to bind specific servlets at /, /app and /api.</p>
  
  <p>The Servlet bound to /api extends AbstractCXFServlet and is used to return responses to the RESTful API. However, what I have found is calls to /api have duplicate Date: headers in the response. The servlets at the other endpoints are not CXF based. The <a href="http://pretty-rfc.herokuapp.com/RFC2616#header.date" rel="nofollow">Date: header is required</a>  so removing the <code>server.setSendDateHeader(true)</code> or setting it to false won't work since all the requests to / and /app would then have it missing.</p>
  
  <p>Is there a way to configure Jetty to only add the Date header if it doesn't exist at the end of processing or is there a way to disable CXF from inserting Date: headers?</p>
  
  <p>I'm using Jetty v6.1.19 and CXF v2.3.3.</p>