Feature #1967

Make CGI environment accessible to mod_magnet and lua scripts

Added by presbrey about 5 years ago. Updated about 5 years ago.

Status:FixedStart date:2009-04-27
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:mod_magnet
Target version:-
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 Magnifier (2.16 KB) presbrey, 2009-04-27 14:29

Associated revisions

Revision 2515
Added by stbuehler about 5 years ago

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

Revision 2516
Added by stbuehler about 5 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 about 5 years ago

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

Applied in changeset r2515.

Also available in: Atom