httpd-dev mailing list archives

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

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', 'http://www.example.com') -- 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'] = 'http://www.example.com' -- like in
previous versions of mod_wombat
  or
r:headers_out{Location = 'http://www.example.com} -- but then it
becomes harder to unset a header (?)
  or
r.headers_out:set('Location', 'http://www.example.com')
r.headers_out:get('Location')
r.headers_out:unset('Location')

HTH

-----
Bertrand Mansion
Mamasam

Mime
View raw message