Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317019 - Date HTTP header not sent for HTTP/1.0 requests
Summary: Date HTTP header not sent for HTTP/1.0 requests
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.1.x   Edit
Assignee: Michael Gorovoy CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-16 05:44 EDT by Frode Lundgren CLA
Modified: 2010-10-14 13:01 EDT (History)
4 users (show)

See Also:


Attachments
HttpConnection patch, jetty-7.0.0.v20091005 (793 bytes, patch)
2010-06-16 05:53 EDT, Frode Lundgren CLA
jesse.mcconnell: iplog+
Details | Diff
HttpConnection patch, jetty-8 branch (as of 20100616) (745 bytes, patch)
2010-06-16 05:58 EDT, Frode Lundgren CLA
jesse.mcconnell: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.