|
| 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 | +<?php |
| 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