1
0
mirror of https://github.com/php/php-src.git synced 2026-04-16 04:21:18 +02:00

Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix test wrt. server.inc changes
This commit is contained in:
Christoph M. Becker
2021-03-03 12:05:03 +01:00

View File

@@ -1,7 +1,7 @@
--TEST--
Bug #78719 (http wrapper silently ignores long Location headers)
--SKIPIF--
<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?>
<?php require 'server.inc'; http_server_skipif(); ?>
--INI--
allow_url_fopen=1
--FILE--
@@ -12,10 +12,10 @@ $url = str_repeat('*', 2000);
$responses = array(
"data://text/plain,HTTP/1.0 302 Ok\r\nLocation: $url\r\n\r\nBody",
);
$pid = http_server("tcp://127.0.0.1:12342", $responses, $output);
['pid' => $pid, 'uri' => $uri] = http_server($responses);
$context = stream_context_create(['http' => ['follow_location' => 0]]);
$stream = fopen('http://127.0.0.1:12342/', 'r', false, $context);
$stream = fopen($uri, 'r', false, $context);
var_dump(stream_get_contents($stream));
var_dump(stream_get_meta_data($stream)['wrapper_data'][1] === "Location: $url");