Permalink
Browse files

MINOR Only set X-Pjax header in redirections if it doesn't already ex…

…ist in the response
  • Loading branch information...
1 parent e23a758 commit c81d0e1222077f8d49a5a5761b91dd906f791d03 @chillu chillu committed Jun 14, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 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);

0 comments on commit c81d0e1

Please sign in to comment.