# HG changeset patch # User Igor Sysoev # Date 1261753208 0 # Node ID 6cc74c87c656e3ac847efb82cb98d8ca181f85e4 # Parent 2c07eba97f43083680482f77818e75ff412caa44 fix negative time in "Cache-Control" if "expires modified" sets time in the past diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c --- a/src/http/modules/ngx_http_headers_filter_module.c +++ b/src/http/modules/ngx_http_headers_filter_module.c @@ -291,7 +291,7 @@ ngx_http_set_expires(ngx_http_request_t ngx_http_time(expires->value.data, expires_time); - if (conf->expires_time < 0) { + if (conf->expires_time < 0 || max_age < 0) { cc->value.len = sizeof("no-cache") - 1; cc->value.data = (u_char *) "no-cache";