Opened 2 years ago

Last modified 6 months ago

#1316 new defect

$http_ variables only contain the first field-value

Reported by: vfaronov@… Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.13.x
Keywords: Cc:
uname -a: Linux pergamon 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.13.3 built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) configure arguments: --prefix=/home/vasiliy/tmp/nginx-1.13.3/prefix --with-debug

Description

The value of the $http_X variable is the field-value of the first request header field named X. Further field-values, if any, are not included in the variable.

For example, given a request like:

GET / HTTP/1.1
Host: example.com
Forwarded: for=123.45.67.89
Forwarded: for=234.56.78.90

the value of $http_forwarded is for=123.45.67.89.

A more useful value would be for=123.45.67.89,for=234.56.78.90 (per RFC 7230 § 3.2.2).

Failing that, at least the current behavior should be documented.

Change History (1)

comment:1 Changed 6 months ago by mdounin

See also #1762.

Note: See TracTickets for help on using tickets.