diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2011-10-17 17:32:08 +0000 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2011-10-17 17:32:08 +0000 |
commit | b167c46ca24c8f94795f7cde9a9ebdc52c24260e (patch) | |
tree | 42b2629cb8e07b1dcd0519f445f1ce068db211bd /src | |
parent | 81b43370d5be40d490e1969742b5ac070249613a (diff) | |
download | nginx-b167c46ca24c8f94795f7cde9a9ebdc52c24260e.tar.gz nginx-b167c46ca24c8f94795f7cde9a9ebdc52c24260e.zip |
Fixed "expires @time" with unknown last modified time (ticket #32).
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_headers_filter_module.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c index 852445069..c846c5fea 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 @@ 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; |