The attached patch changes headers_in and headers_out handling in
mod_lua as boxed userdata rather than functions.

Basically we go from:

-- OLD
function handle(r)
  local host = r.headers_in("host")
  r:puts(host)
end

to

-- NEW
function handle(r)
  local host = r.headers_in['host']
  r:puts(host)

  -- and can now modify them
  r.headers_in['X-XX-Fake'] = 'rabbits!'
  r.headers_out['wombat'] = 'lua now!'
end

In order to treat tables idiommatically, it also corrects the
apl_push_apr_table(..) function to behave as a regular lua style push
function instead of a set function.

-Brian

Attachment: apr_table_and_headers_in.patch
Description: Binary data

Reply via email to