Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#32 closed defect (fixed)

expires header not set correctly using '@' format

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

Attachments (1)

patch-nginx-expires-daily.txt (1.8 KB ) - added by Maxim Dounin 13 years ago.

Download all attachments as: .zip

Change History (6)

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.

comment:2 by Maxim Dounin, 13 years ago

In [4218/nginx]:

Fixed "expires @time" with unknown last modified time (ticket #32).

comment:3 by Maxim Dounin, 13 years ago

Resolution: fixed
Status: assignedclosed

Fix committed, thanks.

comment:4 by time4tea.myopenid.com, 13 years ago

I came back to post a patch - but i see i was too slow! - thanks for fixing that!

comment:5 by Maxim Dounin, 13 years ago

In [4351/nginx]:

Merge of r4217, r4218:

Fixed "expires @00h". Fixed "expires @time" with unknown last modified
time (ticket #32).

Note: See TracTickets for help on using tickets.