On Mon, Jan 12, 2009 at 2:07 AM, Bertrand Mansion <bmans...@mamasam.net> wrote:
.. snip .. >> 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). > I believe it does -- header_in and headers_out are boxed apr_table_t instances and the only thing they have in their metatable are __index and __newindex. If they are not checking for strings, that is a bug as apr_table_t is string only. -Brian