Fixed "expires @time" with unknown last modified time (ticket #32).
diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c
index 8524450..c846c5f 100644
--- a/src/http/modules/ngx_http_headers_filter_module.c
+++ b/src/http/modules/ngx_http_headers_filter_module.c
@@ -262,16 +262,16 @@
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;