bug #22292 Fixes #22264 - add support for Chrome headless (redthor)

This PR was merged into the 2.7 branch.

Discussion
----------

Fixes #22264 - add support for Chrome headless

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22264
| License       | MIT
| Doc PR        |

Commits
-------

a03dbd2cca Fixes #22264 - add support for Chrome headless, see also Seldaek/monolog#966
This commit is contained in:
Fabien Potencier 2017-04-05 06:41:26 -07:00
commit cb49907570
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ class ChromePhpHandler extends BaseChromePhpHandler
return;
}
if (!preg_match('{\b(?:Chrome/\d+(?:\.\d+)*|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}', $event->getRequest()->headers->get('User-Agent'))) {
if (!preg_match('{\b(?:Chrome/\d+(?:\.\d+)*|HeadlessChrome|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}', $event->getRequest()->headers->get('User-Agent'))) {
$this->sendHeaders = false;
$this->headers = array();