Welcome! Log In Create A New Profile

Advanced

Re: The "headers_more" module: Set and clear output headers...more than "add"!

agentzh
November 18, 2009 02:54AM
On Wed, Nov 18, 2009 at 10:18 AM, agentzh <agentzh@gmail.com> wrote:
>
> But another TODO comes into my mind: adding support for input headers!
> Stay tuned :)
>

Okay, the input header support has finally landed in v0.05 after a few
hours' big refactoring and hacking. Here's some funny examples:

location /foo {
set $my_host 'my dog';
more_set_input_headers 'Host: $my_host';
more_set_input_headers -t 'text/plain' 'X-Foo: bah';

# now $host and $http_host have their new values...
}

The "input header filter" runs in the access phase. I'm not sure if
it's completely right but this phase lets me pass all the related
tests in

http://github.com/agentzh/headers-more-nginx-module/blob/master/test/t/input.t

and

http://github.com/agentzh/headers-more-nginx-module/blob/master/test/t/vars.t

while other phases break things horribly :)

Theoretically it should also work with subrequests. But unfortunately
the ngx_http_subrequest function in the core seems to be buggy
regarding r->headers_in handling IIRC. So be careful with that :)

I'll work on the wiki page for this module soon.

Enjoy!
-agentzh
Subject Author Posted

The "headers_more" module: Set and clear output headers...more than "add"!

agentzh November 17, 2009 05:04AM

Re: The "headers_more" module: Set and clear output headers...more than "add"!

agentzh November 17, 2009 09:24PM

Re: The "headers_more" module: Set and clear output headers...more than "add"!

agentzh November 18, 2009 02:54AM

Re: The "headers_more" module: Set and clear output headers...more than "add"!

agentzh November 18, 2009 05:02AM

Re: The "headers_more" module: Set and clear output headers...more than "add"!

rmalayter December 04, 2009 10:19AM

Re: The "headers_more" module: Set and clear output headers...more than "add"!

Joshua Zhu November 17, 2009 10:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 75
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready