]> git.kaiwu.me - nginx.git/commitdiff
Fixed "expires @time" with unknown last modified time (ticket #32).
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 17 Oct 2011 17:32:08 +0000 (17:32 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 17 Oct 2011 17:32:08 +0000 (17:32 +0000)
src/http/modules/ngx_http_headers_filter_module.c

index 8524450698f66c5447e1d45441fd48386b76d168..c846c5fea97a42e219d7702fddabc0da0eecf8e8 100644 (file)
@@ -262,16 +262,16 @@ ngx_http_set_expires(ngx_http_request_t *r, ngx_http_headers_conf_t *conf)
 
     now = ngx_time();
 
-    if (conf->expires == NGX_HTTP_EXPIRES_ACCESS
-        || r->headers_out.last_modified_time == -1)
+    if (conf->expires == NGX_HTTP_EXPIRES_DAILY) {
+        expires_time = ngx_next_time(conf->expires_time);
+        max_age = expires_time - now;
+
+    } else if (conf->expires == NGX_HTTP_EXPIRES_ACCESS
+               || r->headers_out.last_modified_time == -1)
     {
         expires_time = now + conf->expires_time;
         max_age = conf->expires_time;
 
-    } else if (conf->expires == NGX_HTTP_EXPIRES_DAILY) {
-        expires_time = ngx_next_time(conf->expires_time);
-        max_age = expires_time - now;
-
     } else {
         expires_time = r->headers_out.last_modified_time + conf->expires_time;
         max_age = expires_time - now;