diff src/http/ngx_http_header_filter.c @ 432:11362a3e3911

nginx-0.0.11-2004-09-21-09:38:28 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 21 Sep 2004 05:38:28 +0000
parents 694cd6cdb714
children e56ab5ac8c65
line wrap: on
line diff
--- a/src/http/ngx_http_header_filter.c
+++ b/src/http/ngx_http_header_filter.c
@@ -131,6 +131,16 @@ static ngx_int_t ngx_http_header_filter(
         r->header_only = 1;
     }
 
+    if (r->headers_out.last_modified_time != -1) {
+        if (r->headers_out.status != NGX_HTTP_OK
+            && r->headers_out.status != NGX_HTTP_NOT_MODIFIED
+            && r->headers_out.status != NGX_HTTP_PARTIAL_CONTENT)
+        {
+            r->headers_out.last_modified_time = -1;
+            r->headers_out.last_modified = NULL;
+        }
+    }
+
     /* 2 is for trailing "\r\n" and 2 is for "\r\n" in the end of header */
     len = sizeof("HTTP/1.x ") - 1 + 2 + 2;