]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DOC: fix lua use-service example
authorPieter Baauw <piba.nl.dev@gmail.com>
Thu, 1 Oct 2015 20:47:12 +0000 (22:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 1 Oct 2015 22:53:57 +0000 (00:53 +0200)
doc/lua-api/index.rst

index 1f02541ffe1b4e35e4e828c6819ade9c486e5668..54eae8fa8c8c9dd3107815f86752190ea559e97c 100644 (file)
@@ -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)