Commit 61767861 by tof06

Add X-PJAX-URL header when redirect a pjax request

parent 8c1d39b3
......@@ -678,7 +678,9 @@ class Response extends \yii\base\Response
$url = Yii::$app->getRequest()->getHostInfo() . $url;
}
if (Yii::$app->getRequest()->getIsAjax()) {
if (Yii::$app->getRequest()->getIsPjax()) {
$this->getHeaders()->set('X-PJAX-URL', $url);
} elseif (Yii::$app->getRequest()->getIsAjax()) {
$this->getHeaders()->set('X-Redirect', $url);
} else {
$this->getHeaders()->set('Location', $url);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment