httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bertrand Mansion" <>
Subject mod_lua headers_out
Date Sun, 11 Jan 2009 12:21:50 GMT

My name is Bertrand Mansion, I live in Paris, France, I have been
mostly programming in PHP for the last few years and I am very excited
about mod_lua since I consider Lua is superior in many ways. I have
followed the development of mod_wombat and noticed that you changed
the way headers_in and headers_out are accessed, they were previously
tables, now only headers_in can be accessed through a headers_in()
method. I have written a method to have access to headers_out as well.
I am not sure it is perfect since I haven't coded with Lua and apr C
APIs before and many you thought already about something more clever.

Anyway, with this patch, you can do:
r:headers_out('Location', '') -- set the Location header
r:headers_out('Location) -- return the current value for header Location
r:headers_out('Location', nil) -- unset the Location header

There might be other options I haven't implemented for example:

r.headers_out['Location'] = '' -- like in
previous versions of mod_wombat
r:headers_out{Location = '} -- but then it
becomes harder to unset a header (?)
r.headers_out:set('Location', '')


Bertrand Mansion

View raw message