From c81d0e1222077f8d49a5a5761b91dd906f791d03 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 14 Jun 2012 20:20:29 +0200 Subject: [PATCH] MINOR Only set X-Pjax header in redirections if it doesn't already exist in the response --- admin/code/LeftAndMain.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 38b2bb21ffc..e1e27983cc9 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -353,7 +353,9 @@ function handleRequest(SS_HTTPRequest $request, DataModel $model = null) { function redirect($url, $code=302) { if($this->request->isAjax()) { $this->response->addHeader('X-ControllerURL', $url); - if($header = $this->request->getHeader('X-Pjax')) $this->response->addHeader('X-Pjax', $header); + if($this->request->getHeader('X-Pjax') && !$this->response->getHeader('X-Pjax')) { + $this->response->addHeader('X-Pjax', $this->request->getHeader('X-Pjax')); + } return ''; // Actual response will be re-requested by client } else { parent::redirect($url, $code);