summaryrefslogtreecommitdiffstats
path: root/modules/http
diff options
context:
space:
mode:
authorJustin Erenkrantz <jerenkrantz@apache.org>2002-09-01 20:31:30 +0200
committerJustin Erenkrantz <jerenkrantz@apache.org>2002-09-01 20:31:30 +0200
commita85a3814b8b873bb1f94bfe8141362229f49683b (patch)
tree136a5a42bb6578732482f96d18191abb6e53b421 /modules/http
parentDocument the updates to leader/followers MPM (diff)
downloadapache2-a85a3814b8b873bb1f94bfe8141362229f49683b.tar.xz
apache2-a85a3814b8b873bb1f94bfe8141362229f49683b.zip
Fix FileETag None directive.
- Fix segfault on strlen computation on the empty string in vlv case - If the etag is "", don't set the ETag header to be "" - leave the header NULL instead. Andrew's patch would change ap_meets_condition to accept "", but Justin thinks it would be better just to sidestep it all together and not set ETag when it would be "". PR: 12207 Submitted by: Andrew Ho <andrew@tellme.com> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96609 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http')
-rw-r--r--modules/http/http_protocol.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c
index 599adeb8a7..faf6463ba2 100644
--- a/modules/http/http_protocol.c
+++ b/modules/http/http_protocol.c
@@ -2659,6 +2659,11 @@ AP_DECLARE(void) ap_set_etag(request_rec *r)
if (!r->vlist_validator) {
etag = ap_make_etag(r, 0);
+
+ /* If we get a blank etag back, don't set the header. */
+ if (!etag[0]) {
+ return;
+ }
}
else {
/* If we have a variant list validator (vlv) due to the
@@ -2682,8 +2687,12 @@ AP_DECLARE(void) ap_set_etag(request_rec *r)
variant_etag = ap_make_etag(r, vlv_weak);
- /* merge variant_etag and vlv into a structured etag */
+ /* If we get a blank etag back, don't append vlv and stop now. */
+ if (!variant_etag[0]) {
+ return;
+ }
+ /* merge variant_etag and vlv into a structured etag */
variant_etag[strlen(variant_etag) - 1] = '\0';
if (vlv_weak) {
vlv += 3;