From: Pieter Baauw Date: Thu, 1 Oct 2015 20:47:12 +0000 (+0200) Subject: DOC: fix lua use-service example X-Git-Tag: v1.6-dev7~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dcb9bc5bff9ef64d345378f0bd93c4ff35bfc29;p=thirdparty%2Fhaproxy.git DOC: fix lua use-service example --- diff --git a/doc/lua-api/index.rst b/doc/lua-api/index.rst index 1f02541ffe..54eae8fa8c 100644 --- a/doc/lua-api/index.rst +++ b/doc/lua-api/index.rst @@ -408,12 +408,12 @@ Core class .. code-block:: lua - core.register_service("hello-world", "http" }, function(txn) + core.register_service("hello-world", "http" }, function(applet) local response = "Hello World !" applet:set_status(200) - applet:add_header("content-length", string.length(response)) + applet:add_header("content-length", string.len(response)) applet:add_header("content-type", "text/plain") - applet:start_reponse() + applet:start_response() applet:send(response) end) .. @@ -1361,12 +1361,12 @@ AppletHTTP class This is an hello world sample code: .. code-block:: lua - core.register_service("hello-world", "http" }, function(txn) + core.register_service("hello-world", "http" }, function(applet) local response = "Hello World !" applet:set_status(200) - applet:add_header("content-length", string.length(response)) + applet:add_header("content-length", string.len(response)) applet:add_header("content-type", "text/plain") - applet:start_reponse() + applet:start_response() applet:send(response) end)