Fix #17932: Fix regression in detection of AJAX requests (#17937)

This commit is contained in:
Alexander Makarov
2020-03-26 12:30:56 +03:00
committed by GitHub
parent e9f42c0854
commit 65e5640810
3 changed files with 2 additions and 26 deletions

View File

@ -487,13 +487,7 @@ class Request extends \yii\base\Request
*/
public function getIsAjax()
{
$origin = $this->headers->get('Origin');
return
($this->headers->get('X-Requested-With') === 'XMLHttpRequest') ||
($this->headers->get('Sec-Fetch-Mode') === 'cors') ||
($this->headers->get('Sec-Fetch-Site') === 'cross-site') ||
($origin !== null && $origin !== $this->getHostInfo());
return $this->headers->get('X-Requested-With') === 'XMLHttpRequest';
}
/**