diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-11-27 12:02:58 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-11-27 12:02:58 +0000 |
commit | 98b5a3b15b95c04a352fbad0867a37eabb20747d (patch) | |
tree | 8e8c1f1ef4b4e4daa7300fc243a626f88b15fbb8 | |
parent | 32717eb60ce2adbb68cfcf4250da2bc7ecbfe856 (diff) | |
download | nginx-98b5a3b15b95c04a352fbad0867a37eabb20747d.tar.gz nginx-98b5a3b15b95c04a352fbad0867a37eabb20747d.zip |
add_header last-modified ""
-rw-r--r-- | src/http/modules/ngx_http_headers_filter_module.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c index 81f4eb171..06c91bcca 100644 --- 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_request_t *r, ngx_http_header_val_t *hv, 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_request_t *r, ngx_http_header_val_t *hv, } 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; } |