php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25204 ETag Responce Header Ignored
Submitted: 2003-08-22 02:47 UTC Modified: 2003-08-24 08:15 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: support at inmarket dot lviv dot ua Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 4.3.2 OS: win32
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: support at inmarket dot lviv dot ua
New email:
PHP Version: OS:

 

 [2003-08-22 02:47 UTC] support at inmarket dot lviv dot ua
Description:
------------
Actually I posted this bug to Apache, but they said this is PHP bug.

I noticed that ETag responce header from PHP script is simply ignored. If there comes a request with "If-None-Match" and the script responds with "ETag" that matches it, the server responds with "200 OK" status. When checked with static content, Apache has no problem responding with "304 Not Modified". 
There is no problem when script responds with "Last-Modified", and the server then ends up with "304 Not Modified". 

What I got from Apache bug report system:

This is a php bug. The handler (read: PHP) is responsible for calling
ap_meets_conditions at the proper place (i.e. before sending the content) or
doing the evaluation that takes place there itself.

Please address this issue to the php bug database.

Regards,
Dennis

Reproduce code:
---------------
Request:
GET /temp/etag.php HTTP/1.1
If-None-Match: "0-1234-12345678"

Responce:
HTTP/1.1 200 OK  -- should be 304 as for static content is
ETag: "0-1234-12345678"

Whereas using time-related headers:
Request:
GET /temp/etag.php HTTP/1.1
If-Modified-Since: Thu, 31 Jul 2003 19:12:11 GMT

Responce:
HTTP/1.1 304 Not Modified  -- as expected
Last-Modified: Thu, 31 Jul 2003 19:12:11 GMT

Also combining two kinds of headers is useless:
Request:
GET /temp/etag.php HTTP/1.1
If-None-Match: "0-1234-12345678"
If-Modified-Since: Thu, 31 Jul 2003 19:12:11 GMT

Responce:
HTTP/1.1 200 OK  -- Note this happens despite Last-Modified!
ETag: "0-1234-12345678"
Last-Modified: Thu, 31 Jul 2003 19:12:11 GMT



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-22 03:21 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Also, what is in your script?
Which apache version? 
How did you configure PHP?

 [2003-08-22 09:52 UTC] support at inmarket dot lviv dot ua
The test script simply sends "ETag" header via header("ETag: 0-1234-12345678");

My Apache is win32 1.3.28, PHP 4.3.2 CGI - default configuration
 [2003-08-22 19:57 UTC] sniper@php.net
This is not really Apache related but CGI. If you were really using the apache module, this would propably work just fine.
See: http://www.mnot.net/cgi_buffer/

 [2003-08-23 11:36 UTC] support at inmarket dot lviv dot ua
And what if some stupid hosting provider has PHP thru CGI??? Like mine does! And, after all, why does this happen? This must be a trivial task to fix?
 [2003-08-23 11:38 UTC] support at inmarket dot lviv dot ua
And whose problem is this: Apache or PHP?
 [2003-08-24 08:15 UTC] sniper@php.net
Neither, you're supposed to handle it yourself, see the url I pasted in my previous comment..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 20:01:30 2024 UTC