Bertrand, I just send in a patch on the message with subject "patch for handling headers_in and headers_out as tables in mod_lua" which takes knowledge of setting headers_in, headers_out off the request which, with that patch, can just push the apr_table_t as a boxed pointer allowing lua-style [] access and modification.
Does that work? -Brian On Sun, Jan 11, 2009 at 4:21 AM, Bertrand Mansion <bmans...@mamasam.net> wrote: > 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 >