Bug in request.headers_out initialization?

Fasih faskiri.devel at gmail.com
Wed Nov 23 17:28:41 UTC 2011

On Wed, Nov 23, 2011 at 10:38 PM, Igor Sysoev <igor at sysoev.ru> wrote:

> On Wed, Nov 23, 2011 at 10:32:27PM +0530, Fasihullah Askiri wrote:
> > Sorry, I am not sure I understood you correctly. It is used in headers_in
> > for look up into headers_in_hash OK. But what about headers_out?
> "lowcase_key" in headers_out may be not set if these headers are not
> proxied/fastcgied/etc.
> > ngx_http_proxy_process_header parses the upstream response headers
> > using ngx_http_parse_header_line, thereby setting hash/lowcase_key. This
> > function sets headers_out which I use. The question I have is, is it safe
> > to use the headers_out.....lowcase_key, should I check for
> > headers_out.headers.part.elt[it].hash before I can use lowcase_key or
> > should I check for something else?
> "hash" does not mean that "lowcase_key" is set.
> If nginx needs to find headers using hash, it sets "lowcase_key" and
> calculates "hash".
So, if header "xyz-header" is not expected to be found in a hash,  nginx
would not calculate the lowcase_key, but will it also set
headers_out.header.elt.hash to some value to signal that it has not
calculated the lowcase_key?

> Besides nginx uses "hash" only in header output filter.
Understood, but the problem is because I am trying to reuse that variable
probably for something that it was intended to be used, just wanted to find
out how to use it if at all I can use it.

Thanks again for your patience..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20111123/6102329a/attachment.html>

More information about the nginx-devel mailing list