Quantcast
Channel: Serverphorums.com - HAProxy
Viewing all articles
Browse latest Browse all 5112

http_date converter gives wrong date (3 replies)

$
0
0
Hi!

I've been using HAProxy 1.6.3 on XUbuntu 14.04 64.bit.
In my haproxy.conf I have:
listen proxy_http
bind 127.0.0.1:10001
mode http
option httplog
log-tag haproxy-proxy_http_tag
acl auth_ok http_auth(L1)
acl local_net src 192.168.0.0/24
http-request auth realm 'proxy_http realm' if !auth_ok
http-request allow if local_net auth_ok
http-request deny if !local_net !auth_ok
http-request use-service lua.hello-world-http
http-response set-header Expires %[date,http_date]
capture cookie USER_TOKEN len 20
capture request header User-Agent len 64

lua.hello-world-http in defined in lua file like:
core.register_service("hello-world-http", "http", function(applet)
local response = "Hello HTTP World!\n"
applet:set_status(200)
applet:add_header("content-length", string.len(response))
applet:add_header("content-type", "text/plain")
applet:add_header("server_name", applet.headers["user-agent"][0])
applet:start_response()
applet:send(response)
end)

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.

Best regards,
Kovi

--
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~

Viewing all articles
Browse latest Browse all 5112

Trending Articles