2008-02-28
2008-02-28 15:27:34 by Jonas Wallden <jonasw@roxen.com>
-
65e9af9fdb273c723e95116d0104aabedf202431
(26 lines)
(+18/-8)
[
Show
| Annotate
]
Branch: 5.2
If a request has both If-Modified-Since and If-None-Match a failed Etag match
must not result in a 304 response even if the timestamp is equal.
Rev: server/protocols/http.pike:1.551
2:
// Modified by Francesco Chemolli to add throttling capabilities.
// Copyright © 1996 - 2004, Roxen IS.
- constant cvs_version = "$Id: http.pike,v 1.550 2008/02/19 17:09:38 mast Exp $";
+ constant cvs_version = "$Id: http.pike,v 1.551 2008/02/28 15:27:34 jonasw Exp $";
// #define REQUEST_DEBUG
#define MAGIC_ERROR
2640: Inside #if defined(RAM_CACHE)
int len = sizeof(d);
// Make sure we don't mess with the RAM cache.
file += ([]);
- if (none_match &&
- (none_match[file->etag] ||
- (none_match["*"] && file->etag))) {
+ if (none_match) {
+ // RFC 2616, Section 14.26:
+ //
+ // If none of the entity tags match, then the server
+ // MAY perform the requested method as if the
+ // If-None-Match header field did not exist, but MUST
+ // also ignore any If-Modified-Since header field(s) in
+ // the request. That is, if no entity tags match, then
+ // the server MUST NOT return a 304 (Not Modified)
+ // response.
+ if (none_match[file->etag] || (none_match["*"] && file->etag)) {
// Not modified.
code = 304;
d = "";
len = 0;
-
+ }
} else if (since && file->last_modified) {
array(int) since_info = Roxen.parse_since( since );
if ((since_info[0] >= file->last_modified) &&