xref: /PHP-7.4/sapi/fpm/tests/bug80849-fpm.phpt (revision a054ef2a)
1--TEST--
2Bug #80849 (HTTP Status header truncation)
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--FILE--
6<?php
7require_once "tester.inc";
8
9$cfg = <<<EOT
10[global]
11error_log = {{FILE:LOG}}
12[unconfined]
13listen = {{ADDR}}
14pm = dynamic
15pm.max_children = 5
16pm.start_servers = 1
17pm.min_spare_servers = 1
18pm.max_spare_servers = 3
19EOT;
20
21$code = <<<EOT
22<?php
23header('HTTP/1.1 201 ' . str_repeat('A', 1014), true);
24EOT;
25
26$tester = new FPM\Tester($cfg, $code);
27$tester->start();
28$tester->expectLogStartNotices();
29$tester
30    ->request()
31    ->expectHeader('Status', '201 ' . str_repeat('A', 1011));
32$tester->terminate();
33$tester->close();
34?>
35--CLEAN--
36<?php
37require_once "tester.inc";
38FPM\Tester::clean();
39?>
40--EXPECT--
41