You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2018/05/25 19:21:42 UTC

svn commit: r1832273 - in /httpd/test/framework/trunk/t: htdocs/modules/lua/setheaderfromparam.lua modules/lua.t

Author: jailletc36
Date: Fri May 25 19:21:42 2018
New Revision: 1832273

URL: http://svn.apache.org/viewvc?rev=1832273&view=rev
Log:
Add a mod_lua test.
This allows to generate a response with a header of a given name and value.
The name and the value to be used are passed in the url with respectivelly the 'HeaderName' and the 'HearderValue' parameters.

Added:
    httpd/test/framework/trunk/t/htdocs/modules/lua/setheaderfromparam.lua
Modified:
    httpd/test/framework/trunk/t/modules/lua.t

Added: httpd/test/framework/trunk/t/htdocs/modules/lua/setheaderfromparam.lua
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/lua/setheaderfromparam.lua?rev=1832273&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/lua/setheaderfromparam.lua (added)
+++ httpd/test/framework/trunk/t/htdocs/modules/lua/setheaderfromparam.lua Fri May 25 19:21:42 2018
@@ -0,0 +1,10 @@
+-- Syntax: setheader.lua?HeaderName=foo&HeaderValue=bar
+-- 
+-- This will return a document with 'bar' set in the header 'foo'
+
+function handle(r)
+    local GET, GETMULTI = r:parseargs()
+    
+    r.headers_out[GET['HeaderName']] = GET['HeaderValue']
+    r:puts("Header set")
+end

Modified: httpd/test/framework/trunk/t/modules/lua.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/lua.t?rev=1832273&r1=1832272&r2=1832273&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/lua.t (original)
+++ httpd/test/framework/trunk/t/modules/lua.t Fri May 25 19:21:42 2018
@@ -38,6 +38,9 @@ my @ts = (
     { url => "$pfx/setheaders.lua", rcontent => "",
                                     headers => { "X-Header" => "yes",
                                                  "X-Host"   => $hostport } },
+    { url => "$pfx/setheaderfromparam.lua?HeaderName=foo&HeaderValue=bar",
+                                    rcontent => "Header set",
+                                    headers => { "foo" => "bar" } },
 );
 
 plan tests => 4 * scalar @ts, need 'lua';