Hi Gregor,

Le 22/01/2016 18:01, Gregor Kovač a écrit :
Hi!

I've been using HAProxy 1.6.3 on XUbuntu 14.04 64.bit.
In my haproxy.conf I have:
(...)
     http-response set-header Expires %[date,http_date]
(...)
I test this using curl:
curl --cookie "USER_TOKEN=2345678901;BLA=ena;BILUMINA_SERVERID=3" --user
gregor:kovi http://localhost:10001

The HTTP response I get back:
HTTP/1.1 200 OK
content-length: 40
content-type: text/plain
server_name: curl/7.35.0
Expires: Sat, 22 Jan 2016 17:43:38 GMT

Hello HTTP World!

The problem I have here is that Expires should be Friday and not Saturday.

Confirmed.
The bug is easy to fix : gmtime() returns the day of the week as an int from 0 to 6, where Sunday = 0, whereas the code in haproxy begins on Monday :
        const char day[7][4] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", 
"Sun" };

I'll provide a patch soon.


--
Cyril Bonté

Reply via email to