diff options
author | Graham Leggett <minfrin@apache.org> | 2013-05-06 13:41:10 +0200 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2013-05-06 13:41:10 +0200 |
commit | 997e0f6d33051abddc95b39fcd71a8191d83a22a (patch) | |
tree | 993bfb996f992bb8d0bb9206de1ba46357c8e6da /modules/http | |
parent | mod_cache: Ensure that updated responses to HEAD requests don't get (diff) | |
download | apache2-997e0f6d33051abddc95b39fcd71a8191d83a22a.tar.xz apache2-997e0f6d33051abddc95b39fcd71a8191d83a22a.zip |
core: Add the ability to do explicit matching on weak and strong ETags
as per RFC2616 Section 13.3.3.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479528 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http')
-rw-r--r-- | modules/http/http_protocol.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 2f78612303..b25482dbcf 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -345,8 +345,8 @@ AP_DECLARE(int) ap_meets_conditions(request_rec *r) */ if ((if_match = apr_table_get(r->headers_in, "If-Match")) != NULL) { if (if_match[0] != '*' - && (etag == NULL || etag[0] == 'W' - || !ap_find_list_item(r->pool, if_match, etag))) { + && (etag == NULL + || !ap_find_etag_strong(r->pool, if_match, etag))) { return HTTP_PRECONDITION_FAILED; } } @@ -386,19 +386,18 @@ AP_DECLARE(int) ap_meets_conditions(request_rec *r) } else if (etag != NULL) { if (apr_table_get(r->headers_in, "Range")) { - not_modified = etag[0] != 'W' - && ap_find_list_item(r->pool, - if_nonematch, etag); + not_modified = ap_find_etag_strong(r->pool, if_nonematch, + etag); } else { - not_modified = ap_find_list_item(r->pool, - if_nonematch, etag); + not_modified = ap_find_etag_weak(r->pool, if_nonematch, + etag); } } } else if (if_nonematch[0] == '*' - || (etag != NULL - && ap_find_list_item(r->pool, if_nonematch, etag))) { + || (etag != NULL + && ap_find_etag_strong(r->pool, if_nonematch, etag))) { return HTTP_PRECONDITION_FAILED; } } |