Opened 13 years ago

Last modified 13 years ago

#32 closed defect

expires header not set correctly using '@' format — at Version 1

Reported by: time4tea.myopenid.com Owned by: Maxim Dounin
Priority: minor Milestone:
Component: nginx-core Version: 1.0.x
Keywords: expires Cc:
uname -a:
nginx -V:

Description (last modified by Maxim Dounin)

If upstream does not send last-modified header, @ style expiry times will be interpreted as (now + time)

(from r1.0.8)

ngx_http_headers_filter_module.c line 266
the bug is that the expires header is not set correctly when using @
and it is the case that it is not set correctly, but you will only see the bug if upstream does not set a last-modified header

 if (conf->expires == NGX_HTTP_EXPIRES_ACCESS
        || r->headers_out.last_modified_time == -1)
    {

its the || condition that causes the problem

confirmed on #nginx by PiotrSikora

Change History (2)

by Maxim Dounin, 13 years ago

comment:1 by Maxim Dounin, 13 years ago

Description: modified (diff)
Owner: changed from somebody to Maxim Dounin
Status: newassigned

Attached patch fixes the problem (as well as another one with "expires @00h"). The condition in question is correct, but it should go after NGX_HTTP_EXPIRES_DAILY check.

Note: See TracTickets for help on using tickets.