# HG changeset patch # User Igor Sysoev # Date 1196164978 0 # Node ID b318cdca3aac23b1ac4d61882ff2b6b6f0c485da # Parent e5c547a225bd3c3c26ebad8bb4c0356e84deab27 add_header last-modified "" diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c --- a/src/http/modules/ngx_http_headers_filter_module.c +++ b/src/http/modules/ngx_http_headers_filter_module.c @@ -369,7 +369,14 @@ ngx_http_set_last_modified(ngx_http_requ old = NULL; } + r->headers_out.last_modified_time = -1; + if (old == NULL || *old == NULL) { + + if (value->len == 0) { + return NGX_OK; + } + h = ngx_list_push(&r->headers_out.headers); if (h == NULL) { return NGX_ERROR; @@ -377,14 +384,17 @@ ngx_http_set_last_modified(ngx_http_requ } else { h = *old; + + if (value->len == 0) { + h->hash = 0; + return NGX_OK; + } } h->hash = hv->value.hash; h->key = hv->value.key; h->value = *value; - r->headers_out.last_modified_time = -1; - return NGX_OK; }