Skip to content

Commit

Permalink
MINOR Only set X-Pjax header in redirections if it doesn't already ex…
Browse files Browse the repository at this point in the history
…ist in the response
  • Loading branch information
chillu committed Jun 14, 2012
1 parent e23a758 commit c81d0e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion admin/code/LeftAndMain.php
Expand Up @@ -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);
Expand Down

0 comments on commit c81d0e1

Please sign in to comment.