1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/sapi/cli/tests/gh16137.phpt
David Carlier 3d80d98a10 Fix GH-16137: "Deduplicate" http headers values but Set-Cookie.
Those are meant to have 1 or plus values separated by a comma even
 if the client set them separately.

close GH-16154
2024-10-03 22:45:31 +01:00

21 lines
540 B
PHP

--TEST--
Bug GH-16137 duplicate *Forwarded* HTTP headers values.
--INI--
allow_url_fopen=1
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
include "php_cli_server.inc";
php_cli_server_start("echo \$_SERVER['HTTP_X_FORWARDED_FOR'];");
$ctx = stream_context_create(array('http' => array (
'method' => 'POST',
'header' => array('x-forwarded-for: 127.0.0.1', 'x-forwarded-for: 192.168.1.254')
)));
var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, true, $ctx));
?>
--EXPECT--
string(24) "127.0.0.1, 192.168.1.254"