summaryrefslogtreecommitdiffstats
path: root/modules/http
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2013-05-06 13:41:10 +0200
committerGraham Leggett <minfrin@apache.org>2013-05-06 13:41:10 +0200
commit997e0f6d33051abddc95b39fcd71a8191d83a22a (patch)
tree993bfb996f992bb8d0bb9206de1ba46357c8e6da /modules/http
parentmod_cache: Ensure that updated responses to HEAD requests don't get (diff)
downloadapache2-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.c17
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;
}
}