=== modified file 'src/client_side_reply.cc'
--- src/client_side_reply.cc	2009-04-08 10:01:57 +0000
+++ src/client_side_reply.cc	2009-05-08 00:22:09 +0000
@@ -86,8 +86,9 @@
 clientReplyContext::clientReplyContext(ClientHttpRequest *clientContext) : http (cbdataReference(clientContext)), old_entry (NULL), old_sc(NULL), deleting(false)
 {}
 
-/* create an error in the store awaiting the client side to read it. */
-/* This may be better placed in the clientStream logic, but it has not been
+/** Create an error in the store awaiting the client side to read it.
+ *
+ * This may be better placed in the clientStream logic, but it has not been
  * relocated there yet
  */
 void
@@ -1199,10 +1200,12 @@
     return result;
 }
 
-/*
- * filters out unwanted entries from original reply header
- * adds extra entries if we have more info than origin server
- * adds Squid specific entries
+/**
+ * Generate the reply headers sent to client.
+ *
+ * Filters out unwanted entries and hop-by-hop from original reply header
+ * then adds extra entries if we have more info than origin server
+ * then adds Squid specific entries
  */
 void
 clientReplyContext::buildReplyHeader()
@@ -1228,6 +1231,7 @@
 
     //    if (request->range)
     //      clientBuildRangeHeader(http, reply);
+
     /*
      * Add a estimated Age header on cache hits.
      */
@@ -1278,7 +1282,17 @@
                 hdr->putStr(HDR_WARNING, tempbuf);
             }
         }
+    }
 
+    /* RFC 2616: Section 14.18
+     *
+     * Add a Date: header if missing.
+     * We have access to a clock therefore are required to amend any shortcoming in servers.
+     *
+     * NP: done after Age: to prevent ENTRY_SPECIAL double-handling this header.
+     */
+    if ( !hdr->has(HDR_DATE) ) {
+        hdr->insertTime(HDR_DATE, squid_curtime);
     }
 
     /* Filter unproxyable authentication types */


