xref: /PHP-8.3/sapi/cli/tests/bug73630a.phpt (revision 9b7b4c47)
1--TEST--
2Bug #73630 (Built-in Weberver - overwrite $_SERVER['request_uri'])
3--DESCRIPTION--
4Check that too long paths result in invalid request
5--SKIPIF--
6<?php
7include "skipif.inc";
8?>
9--FILE--
10<?php
11$code = <<<'EOF'
12echo "won't happen\n";
13EOF;
14
15include "php_cli_server.inc";
16php_cli_server_start($code);
17
18$host = PHP_CLI_SERVER_HOSTNAME;
19$fp = php_cli_server_connect();
20$path = "/" . str_repeat("x", 16400) . "//example.com";
21var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "$path"));
22?>
23--EXPECTF--
24Warning: file_get_contents(http://%s//example.com): Failed to open stream: HTTP request failed! in %s on line %d
25bool(false)
26