1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/standard/tests/http/bug75535.phpt
Gina Peter Banyard 47a199c8b4 Add http_(get|clear)_last_reponse_headers() functions (#12500)
This is to provide an alternative to the $http_response_header magic variable

RFC: https://wiki.php.net/rfc/http-last-response-headers
2024-02-29 16:41:09 +00:00

41 lines
764 B
PHP

--TEST--
Bug #75535: Inappropriately parsing HTTP response leads to PHP segment fault
--SKIPIF--
<?php require 'server.inc'; http_server_skipif(); ?>
--INI--
allow_url_fopen=1
--FILE--
<?php
require 'server.inc';
$responses = array(
"data://text/plain,HTTP/1.0 200 Ok\r\nContent-Length\r\n",
);
['pid' => $pid, 'uri' => $uri] = http_server($responses, $output);
var_dump(http_get_last_response_headers());
var_dump(file_get_contents($uri));
var_dump($http_response_header);
var_dump(http_get_last_response_headers());
http_server_kill($pid);
?>
--EXPECT--
NULL
string(0) ""
array(2) {
[0]=>
string(15) "HTTP/1.0 200 Ok"
[1]=>
string(14) "Content-Length"
}
array(2) {
[0]=>
string(15) "HTTP/1.0 200 Ok"
[1]=>
string(14) "Content-Length"
}