Hello!
On Wed, Oct 1, 2014 at 1:04 AM, Gordon Madarm wrote:
> According to the documentation ngx.req.get_headers(raw) should return the
> headers in the case form in which they were received, however the following
> example still returns the headers in lowercase form. How can I enable the
> raw argument to true so that the headers are returned in their original
> form?
>
> location = /header.html {
> content_by_lua '
> local h = ngx.req.get_headers(raw)
Here you are using an uninitialized Lua global variable named "raw"
which takes the nil value.
So you can just pass the true value as the second argument, as in
local h = ngx.req.get_headers(nil, true)
Lua does not support passing arguments by name, so you should use nil
for the first argument ("max_headers") if you do not care about it.
Regards,
-agentzh