We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ab9663 commit e2ae958Copy full SHA for e2ae958
sapi/cli/tests/gh16137.phpt
@@ -0,0 +1,20 @@
1
+--TEST--
2
+Bug GH-16137 duplicate *Forwarded* HTTP headers values.
3
+--INI--
4
+allow_url_fopen=1
5
+--SKIPIF--
6
+<?php
7
+include "skipif.inc";
8
+?>
9
+--FILE--
10
11
+include "php_cli_server.inc";
12
+php_cli_server_start("echo \$_SERVER['HTTP_X_FORWARDED_FOR'];");
13
+$ctx = stream_context_create(array('http' => array (
14
+ 'method' => 'POST',
15
+ 'header' => array('x-forwarded-for: 127.0.0.1', 'x-forwarded-for: 192.168.1.254')
16
+)));
17
+var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, true, $ctx));
18
19
+--EXPECT--
20
+string(23) "127.0.0.1,192.168.1.254"
0 commit comments