mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 13:58:55 +08:00
committed by
GitHub
parent
e9f42c0854
commit
65e5640810
@ -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';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user