mirror of
https://github.com/nginx/nginx.git
synced 2026-10-25 21:42:21 +00:00
Fixed "expires @time" with unknown last modified time (ticket #32).
This commit is contained in:
parent
81b43370d5
commit
b167c46ca2
1 changed files with 6 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue