mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Those are meant to have 1 or plus values separated by a comma even if the client set them separately. close GH-16154
21 lines
540 B
PHP
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"
|