xref: /PHP-8.2/ext/standard/tests/http/bug75535.phpt (revision f39b5c4c)
1--TEST--
2Bug #75535: Inappropriately parsing HTTP response leads to PHP segment fault
3--SKIPIF--
4<?php require 'server.inc'; http_server_skipif(); ?>
5--INI--
6allow_url_fopen=1
7--FILE--
8<?php
9require 'server.inc';
10
11$responses = array(
12    "data://text/plain,HTTP/1.0 200 Ok\r\nContent-Length\r\n",
13);
14
15['pid' => $pid, 'uri' => $uri] = http_server($responses, $output);
16
17var_dump(file_get_contents($uri));
18var_dump($http_response_header);
19
20http_server_kill($pid);
21
22?>
23--EXPECT--
24string(0) ""
25array(2) {
26  [0]=>
27  string(15) "HTTP/1.0 200 Ok"
28  [1]=>
29  string(14) "Content-Length"
30}
31