Received: (qmail 26474 invoked by uid 2012); 21 Dec 1998 07:36:09 -0000 Message-Id: <19981221073609.26473.qmail@hyperreal.org> Date: 21 Dec 1998 07:36:09 -0000 From: Bruno Wolff III Reply-To: bruno@cerberus.csd.uwm.edu To: apbugs@hyperreal.org Subject: CGI Bin scripts can't override the Date header. X-Send-Pr-Version: 3.2 >Number: 3567 >Category: mod_cgi >Synopsis: CGI Bin scripts can't override the Date header. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Class: change-request >Submitter-Id: apache >Arrival-Date: Sun Dec 20 23:40:01 PST 1998 >Last-Modified: Mon Dec 21 07:50:00 PST 1998 >Originator: bruno@cerberus.csd.uwm.edu >Organization: >Release: 1.3.3 >Environment: OSF1 batch2.csd.uwm.edu V4.0 878 alpha Server version: Apache/1.3.3 (Unix) Server built: Dec 15 1998 15:15:40 >Description: I am running a CGI Bin script to process some files and serve them as html files. The CGI Bin script is set up using an action command in a .htaccess file. I am setting Last-Modified headers because I want to the data cached. Last-Modified headers are not supposed to have a time in advance of the Date header. So I tried to create a Date header as well using the current time and then checked to make sure the Last-Modified header was not in the future. However when I looked at the returned date headers, they were not matching the date obtained by my CGI Bin script. In fact they appear to use a time from before the CGI Bin script was run. I noticed this because I had set a Expires header one year in advance and noticed a discrepency in the seconds part of the date and time. I would expect that letting the CGI Bin script override the Date header that the server supplies would be the best answer. If the date header was obtained after the the script ran than at least the test versus the Last-Modified header would work without making guesses about how much delay there can be in running the script. Another alternative would be to pass the date that is going to be used in the date header to the CGI Bin script. (I looked to see if this was done and couldn't find any date information in the environment or standard input.) >How-To-Repeat: Set up an action to run a cgibin script. Have the script obtain the current date and write a date header and the same header with some other name. Then telnet to the web server and issue a HEAD request with a URI that will trigger the action. The returned date header will be less than or equal to the date and time on the test header. At our site I typically saw a 1 second difference, though on at least one occasion there was a 13 second difference. >Fix: Let the Date header returned by the CGI Bin script for the action replace the server generated Date header. >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: coar State-Changed-When: Mon Dec 21 05:44:30 PST 1998 State-Changed-Why: The Date response field is one of those that Apache does not permit to be overridden, since it refers to the time at which the server began sending the response. Other filters or operations that might be performed on a script's output may delay this, or a script might emit a bogus Date field, so this is one of the field reserved to the server itself. See the last paragraph at . Class-Changed-From-To: sw-bug-change-request Class-Changed-By: coar Class-Changed-When: Mon Dec 21 05:44:30 PST 1998 From: Bruno Wolff III To: coar@apache.org, apache-bugdb@apache.org Cc: apbugs@Apache.Org Subject: Re: mod_cgi/3567: CGI Bin scripts can't override the Date header. Date: Mon, 21 Dec 1998 09:45:06 -0600 In that case, I would like to suggest a change to pass a copy of the Date header value in the environment to cgi-bin scripts. This would allow cgi-bin scripts to make sure that their Last-Modified headers aren't greater than their Date headers without having to make guesses about worst case latencies. Thanks for looking into this. On Mon, Dec 21, 1998 at 01:44:31PM -0000, coar@apache.org wrote: > [In order for any reply to be added to the PR database, ] > [you need to include in the Cc line ] > [and leave the subject line UNCHANGED. This is not done] > [automatically because of the potential for mail loops. ] > [If you do not include this Cc, your reply may be ig- ] > [nored unless you are responding to an explicit request ] > [from a developer. ] > [Reply only with text; DO NOT SEND ATTACHMENTS! ] > > > Synopsis: CGI Bin scripts can't override the Date header. > > State-Changed-From-To: open-closed > State-Changed-By: coar > State-Changed-When: Mon Dec 21 05:44:30 PST 1998 > State-Changed-Why: > The Date response field is one of those that Apache does > not permit to be overridden, since it refers to the time > at which the server began sending the response. Other > filters or operations that might be performed on a > script's output may delay this, or a script might emit > a bogus Date field, so this is one of the field reserved > to the server itself. See the last paragraph at > . > Class-Changed-From-To: sw-bug-change-request > Class-Changed-By: coar > Class-Changed-When: Mon Dec 21 05:44:30 PST 1998 >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ] [If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request ] [from a developer. ] [Reply only with text; DO NOT SEND ATTACHMENTS! ]