From fb86ea15206dc9d9e79b991f40ee8dfc6f45f663 Mon Sep 17 00:00:00 2001 From: wleona3 Date: Fri, 3 Mar 2017 11:49:51 -0500 Subject: [PATCH] Send Pjax Header with response to fix redirect Based on this issue: https://github.com/yiisoft/jquery-pjax/issues/44 Seemed to work for me. --- framework/widgets/Pjax.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/widgets/Pjax.php b/framework/widgets/Pjax.php index ee109c5a884..cd72f94e5c8 100644 --- a/framework/widgets/Pjax.php +++ b/framework/widgets/Pjax.php @@ -171,6 +171,11 @@ public function run() $response->setStatusCode(200); $response->format = Response::FORMAT_HTML; $response->content = $content; + + if (!isset($response->headers['X-Pjax-Url'])) { + $response->headers->set('X-Pjax-Url', Yii::$app->request->url); + } + $response->send(); Yii::$app->end();