From b5eb0dcb0afb1be0e21d6f98e0f1476206538860 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Thu, 6 Jun 2013 00:46:17 +0000 Subject: [PATCH] make the example a bit more instructive about the nuances of returning OK w/ r.status set vs. returning a HTTP error code. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1490095 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_lua.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/manual/mod/mod_lua.xml b/docs/manual/mod/mod_lua.xml index ebed897915..471c701c79 100644 --- a/docs/manual/mod/mod_lua.xml +++ b/docs/manual/mod/mod_lua.xml @@ -107,18 +107,24 @@ require "string" --]] function handle(r) r.content_type = "text/plain" - r:puts("Hello Lua World!\n") if r.method == 'GET' then + r:puts("Hello Lua World!\n") for k, v in pairs( r:parseargs() ) do r:puts( string.format("%s: %s\n", k, v) ) end elseif r.method == 'POST' then + r:puts("Hello Lua World!\n") for k, v in pairs( r:parsebody() ) do r:puts( string.format("%s: %s\n", k, v) ) end - else + elseif r.method == 'PUT' then +-- use our own Error contents r:puts("Unsupported HTTP method " .. r.method) + r.status = 405 + return apache2.ok + else +-- use the ErrorDocument return 501 end return apache2.OK -- 2.40.0