Hi. When we use applet, haproxy negociate the conection. (Http version / keepalive). So if the keepalive is enabled and it is accepted by the client, haproxy use keepalive and remove the header close.

If you don't want keepalive, remove it from the haproxy configuration.

Thierry


Le 27 avril 2017 10:10:52 PM Philip Seidel <philipsei...@gmail.com> a écrit :

It appears that the `Connection: close` header is stripped from the HTTP
response when using the AppletHTTP Lua class.  Is there a way add this
response header using this applet?

Example Lua:

-- send a synthetic http response
function send_http_response(applet)
  local content = 'Missing Connection: close header...';
  applet:set_status(200);
  applet:add_header('Content-Length', string.len(content));
  applet:add_header('Content-Type', 'text/plain');
  applet:add_header('Connection', 'close');
  applet:start_response();
  applet:send(content);
end

-- register service
core.register_service('healthcheck', 'http', send_http_response)

Curling returns the following results:

HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 35

Missing Connection: close header...

Thanks,

Phil

Reply via email to