changeset 1655:b318cdca3aac

add_header last-modified ""
author Igor Sysoev <igor@sysoev.ru>
date Tue, 27 Nov 2007 12:02:58 +0000
parents e5c547a225bd
children 7a9b44e35c53
files src/http/modules/ngx_http_headers_filter_module.c
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }