Hello!
On Wed, Oct 10, 2012 at 12:31 AM, T T wrote:
> I am trying to match a "Content-Type: text/html; charset=utf-8"
>
> more_set_headers -t "text/html; charset=utf-8" 'Foo: bar';
>
> Per logs below it appears this creates 2 separate checks:
>
According to the current design, the -t option value is a
space-separated content-type list, so no space is allowed within a
single type. See the documentation for details:
http://wiki.nginx.org/HttpHeadersMoreModule#more_set_headers
In particular:
"syntax: more_set_headers [-t <content-type list>]... [-s <status-code
list>]... <new-header>... "
For this reason,
-t "text/html; charset=utf-8"
really means matching "text/html;" and "charset=utf-8".
I'm not going to change the syntax and semantics here due to
backward-compatibility concerns.
If you want to do complicated response header filtering and
processing, then switch to the ngx_lua module's header_filter_by_lua
directive instead:
http://wiki.nginx.org/HttpLuaModule#header_filter_by_lua
You can use the ngx.header.HEADER Lua API provided by ngx_lua to read
or write any response header that you specify:
http://wiki.nginx.org/HttpLuaModule#ngx.header.HEADER
BTW, I'm cc'ing the openresty-en mailing list:
https://groups.google.com/group/openresty-en And you're welcome to
join us there too :)
Thanks!
-agentzh