Is there an efficient method to get request header by value?

Andy hewanxiang at gmail.com
Mon Jul 28 14:29:06 UTC 2014


Thanks Maxim, then I may have to iterate the list.


Regards,
Andy


On Mon, Jul 28, 2014 at 9:44 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Mon, Jul 28, 2014 at 09:21:07PM +0800, Andy wrote:
>
> > Hi dev,
> >
> > My code need to parse some private request headers, is there any method
> > already in the core to do this job, get the request header by header
> value?
> > I don't want to iterate the array one by one to compare the key. I see
> only
> > some standard headers are set in the request_headers_in hash table.
>
> You mean "by header name"?
> There are two possible ways:
>
> - iterate through the r->headers_in list;
>
> - provide a way to configure variable or a complex value instead
>   of a hardcoded private header name, and use $http_<header> by
>   default.
>
> --
> Maxim Dounin
> http://nginx.org/
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20140728/fd7899df/attachment.html>


More information about the nginx-devel mailing list