On Mon, Jan 12, 2009 at 5:23 AM, Brian McCallister <bri...@skife.org> wrote: > 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?
Yes, it will work, thank you :) The advantage of having a function instead of a table for setting headers_in/headers_out is that you can use luaL_checkstring() to make sure the given parameters are of the correct type. I don't know what the patch will return if someone tries to set a table like in headers_out['Foo'] = {Bar = 'baz'} Maybe it is possible to set a metatable for headers_in/headers_out that would check on __index and __newindex if the value validates with luaL_checkstring (just thinking out loud).