Project

General

Profile

Feature #1967

Make CGI environment accessible to mod_magnet and lua scripts

Added by presbrey about 7 years ago. Updated almost 7 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
mod_magnet
Target version:
-
Start date:
2009-04-27
Due date:
% Done:

100%

Missing in 1.5.x:

Description

This patch makes the CGI environment accessible to lua scripts via mod_magnet.
I tested both get and set methods during both directives: magnet.attract-raw-url-to and magnet.attract-physical-path-to.

The 'lighty' namespace is extended with a new table: lighty.cgi.

Example

print("KRB5CCNAME: " .. lighty.cgi["KRB5CCNAME"] .. " (" .. string.len(lighty.cgi["KRB5CCNAME"]) .. ")")
-- os.spawn('aklog', env={'KRB5CCNAME': lighty.cgi["KRB5CCNAME"]})

Output:
2009-04-27 10:12:10 (mod_magnet.c:197) (lua-print) KRB5CCNAME: /tmp/krb5cc_gssapi_AE3Gxu (25)

Other Notes

As you might have guessed from my example, I developed this for use with the KRB5CCNAME environment variable that is set by my GSSAPI patch: Feature #1899. There are endless uses for this feature, however.

lighty-mod_magnet-r2476.patch View (2.16 KB) presbrey, 2009-04-27 14:29

Associated revisions

Revision 2515 (diff)
Added by stbuehler almost 7 years ago

Add "lighty.req_env" table to mod_magnet for setting/getting environment values for cgi (fixes #1967, thx presbrey)

Revision 4f4d40f3 (diff)
Added by stbuehler almost 7 years ago

Add "lighty.req_env" table to mod_magnet for setting/getting environment values for cgi (fixes #1967, thx presbrey)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2515 152afb58-edef-0310-8abb-c4023f1b3aa9

Revision 2516 (diff)
Added by stbuehler almost 7 years ago

Add "lighty.req_env" table to mod_magnet for setting/getting environment values for cgi (fixes #1967, thx presbrey)

History

#1 Updated by stbuehler almost 7 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2515.

Also available in: Atom