Bug 12207 - If-None-Match requests always return 304 with FileETag None directive
Summary: If-None-Match requests always return 304 with FileETag None directive
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.0-HEAD
Hardware: All All
: P3 critical (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2002-08-31 07:09 UTC by Andrew Ho
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
Patch against httpd-2.0/modules/http/http_protocol.c (476 bytes, patch)
2002-08-31 07:40 UTC, Andrew Ho
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Ho 2002-08-31 07:09:55 UTC
If Apache has the FileETag directive set to "None" and an If-None-Match header 
is sent in a request, Apache always sends back a 304 Not Modified response, 
regardless of the content of the ETag(s) sent in the If-None-Match header.

This bug is pretty high priority, because it means that if a site running 
Apache normally serves ETags but then stops serving them by setting FileETag 
None, any downstream caches which understand ETags and send If-None-Match 
requests will stop getting updated content.

How to reproduce:

    1. Make a regular HTTP request to Apache for any static file,
       and note its ETag.

    2. Make another HTTP request for that file, sending an If-None-Match
       header (for example, if the ETag from step 1 is "abcdef", send
       the header If-None-Match: "abcdef"). Apache should correctly
       return a 304 Not Modified response.

    3. Make a new If-None-Match request with a bogus ETag, for example
       by sending If-None-Match: "xxx". Apache should correctly return
       a 200 OK and include an entity body.

    4. Add a FileETag None directive to the Apache configuration,
       and restart Apache.

    5. Make the same If-None-Match request as in step 2. Again, Apache
       should correctly return a 304 Not Modified response.

    6. Make the same bogus If-None-Match request as in step 3 (or any
       other If-None-Match request with a bogus ETag). Apache will
       incorrectly return a 304 Not Modified response.

Steps 4 and 6 are enough to reproduce the bug but the other steps give a little 
context by showing the correct behavior.

I have reproduced this bug with Apache 2.0.40 on Solaris x86. I strongly 
suspect the bug to be platform independent, as it is a simple missing check in 
http_protocol.c for an empty ETag. Apache 1.3 has an identical bug, for which 
details can be found in Bug 12202.
Comment 1 Andrew Ho 2002-08-31 07:40:44 UTC
Created attachment 2880 [details]
Patch against httpd-2.0/modules/http/http_protocol.c
Comment 2 Andrew Ho 2002-08-31 07:41:04 UTC
Still a problem in HEAD. The attached patch fixes the problem.
Comment 3 Justin Erenkrantz 2002-09-01 18:48:10 UTC
Fixed in revision 1.455 of http_protocol.c.