xref: /PHP-7.4/sapi/cli/tests/bug81305.phpt (revision d1ccb5bd)
1--TEST--
2Bug #81305 (Built-in Webserver Drops Requests With "Upgrade" Header)
3--SKIPIF--
4<?php
5include "skipif.inc";
6?>
7--FILE--
8<?php
9include "php_cli_server.inc";
10php_cli_server_start();
11
12$host = PHP_CLI_SERVER_HOSTNAME;
13$fp = php_cli_server_connect();
14
15if (fwrite($fp, <<<HEADER
16GET / HTTP/1.1
17Host: {$host}
18Upgrade: HTTP/2.0
19Connection: upgrade
20
21
22HEADER)) {
23	fpassthru($fp);
24}
25
26fclose($fp);
27?>
28--EXPECTF--
29HTTP/1.1 200 OK
30Host: %s
31Date: %s
32Connection: close
33X-Powered-By: PHP/%s
34Content-type: text/html; charset=UTF-8
35
36Hello world
37