Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317019

Summary: Date HTTP header not sent for HTTP/1.0 requests
Product: [RT] Jetty Reporter: Frode Lundgren <frodelu>
Component: serverAssignee: Michael Gorovoy <mgorovoy>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: gregw, jesse.mcconnell, jetty-inbox, mgorovoy
Version: unspecified   
Target Milestone: 7.1.x   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
HttpConnection patch, jetty-7.0.0.v20091005
jesse.mcconnell: iplog+
HttpConnection patch, jetty-8 branch (as of 20100616) jesse.mcconnell: iplog+

Description Frode Lundgren CLA 2010-06-16 05:44:48 EDT
Build Identifier: 

With the Date HTTP header now being optionally enabled (through Server.setSendDateHeader()), the Date header will only be returned for HTTP/1.1 requests if enabled - not HTTP/1.0.

If a HTTP/1.0 request is returned without Date header some web accelerators (like squid) fails to cache these results.

I'll submit (an untested) patch to HttpConnection.java that should fix this.

Reproducible: Always

Steps to Reproduce:
1. Setup a Jetty HTTP server
2. Enable the sending of a date header with Server.setSendDateHeader(true)
3. Make a HTTP/1.0 request (e.g. 'GET / HTTP/1.0') against server and verify missing Date HTTP header
Comment 1 Frode Lundgren CLA 2010-06-16 05:53:21 EDT
Created attachment 172022 [details]
HttpConnection patch, jetty-7.0.0.v20091005

This patch should ensure that the Date HTTP header, if enabled, is sent also for HTTP/1.0 requests. Unfortunately, I haven't set up the build environment to test the patch, but as it's a 2 line copy/paste-job from the HTTP/1.1 case, it should work.

This patch was made for jetty-7.0.0.v20091005.
Comment 2 Frode Lundgren CLA 2010-06-16 05:58:58 EDT
Created attachment 172024 [details]
 HttpConnection patch, jetty-8 branch (as of 20100616)

Same proposed patch as in attachment #172022 [details], but for the Jetty 8 branch where we now have a _generator.setDate() method.
Comment 3 Michael Gorovoy CLA 2010-06-16 06:37:03 EDT
Thank you very much for bringing this to our attention.

Committed r2010. (Prematurely committed changes rolled back r2011.)
Comment 4 Michael Gorovoy CLA 2010-06-16 08:46:30 EDT
Jetty 8 will get the changes when respective Jetty 7 release is merged into the branch.