From: Eric Covener Date: Thu, 6 Jun 2013 00:46:17 +0000 (+0000) Subject: make the example a bit more instructive about the nuances X-Git-Tag: 2.5.0-alpha~5380 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5eb0dcb0afb1be0e21d6f98e0f1476206538860;p=apache 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 --- 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