[Reconnoiter-devel] [reconnoiter commit] r886 - trunk/src/modules-lua/noit/module

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Fri Sep 25 18:13:30 EDT 2009


Author: jesus
Date: 2009-09-25 18:13:30 -0400 (Fri, 25 Sep 2009)
New Revision: 886

Modified:
   trunk/src/modules-lua/noit/module/http.lua
Log:
allow method specification, refs #187

Modified: trunk/src/modules-lua/noit/module/http.lua
===================================================================
--- trunk/src/modules-lua/noit/module/http.lua	2009-09-25 22:00:35 UTC (rev 885)
+++ trunk/src/modules-lua/noit/module/http.lua	2009-09-25 22:13:30 UTC (rev 886)
@@ -42,6 +42,10 @@
     <parameter name="url"
                required="required"
                allowed=".+">The URL including schema and hostname (as you would type into a browser's location bar).</parameter>
+    <parameter name="method"
+               required="optional"
+               allowed="\S+"
+               default="GET">The HTTP method to use.</parameter>
     <parameter name="ca_chain"
                required="optional"
                allowed=".+">A path to a file containing all the certificate authorities that should be loaded to validate the remote certificate (for SSL checks).</parameter>
@@ -118,6 +122,7 @@
     local codere = noit.pcre(check.config.code or '^200$')
     local good = false
     local starttime = noit.timeval.now()
+    local method = check.config.method or "GET"
 
     if host == nil then host = check.target end
     if schema == nil then
@@ -167,7 +172,7 @@
     -- perform the request
     local headers = {}
     headers.Host = host
-    client:do_request("GET", uri, headers)
+    client:do_request(method, uri, headers)
     client:get_response()
     local endtime = noit.timeval.now()
     check.available()



More information about the Reconnoiter-devel mailing list