Skip to content

Commit 8e1cef4

Browse files
committed
Do not check X-Powered-By header in FPM tester if expose_php off
Closes GH-9508
1 parent 1ed4303 commit 8e1cef4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sapi/fpm/tests/response.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Response
102102
/**
103103
* Expect header in the response.
104104
*
105-
* @param string $name Header name.
105+
* @param string $name Header name.
106106
* @param string $value Header value.
107107
*
108108
* @return Response
@@ -226,7 +226,7 @@ class Response
226226
{
227227
// check default headers
228228
return (
229-
$this->checkHeader('X-Powered-By', '|^PHP/8|', true) &&
229+
( ! ini_get('expose_php') || $this->checkHeader('X-Powered-By', '|^PHP/8|', true)) &&
230230
$this->checkHeader('Content-type', '|^' . $contentType . '(;\s?charset=\w+)?|', true)
231231
);
232232
}

0 commit comments

Comments
 (0)