]> git.kaiwu.me - nginx.git/commitdiff
Entity tags: empty etags handling in If-Range.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 9 Jul 2012 17:04:37 +0000 (17:04 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 9 Jul 2012 17:04:37 +0000 (17:04 +0000)
Entity tag may be of length 2 as per RFC 2616, i.e. double quotes only.
Pointed out by Ruslan Ermilov.

src/http/modules/ngx_http_range_filter_module.c

index 7a7742105ca2369e078cd0390c36ef861fc77f29..82c202d33c58b81f174406de771501009fd13cfd 100644 (file)
@@ -179,7 +179,7 @@ ngx_http_range_header_filter(ngx_http_request_t *r)
 
         if_range = &r->headers_in.if_range->value;
 
-        if (if_range->len > 2 && if_range->data[if_range->len - 1] == '"') {
+        if (if_range->len >= 2 && if_range->data[if_range->len - 1] == '"') {
 
             if (r->headers_out.etag == NULL) {
                 goto next_filter;