MINOR Only set X-Pjax header in redirections if it doesn't already exist in the response

This commit is contained in:
Ingo Schommer 2012-06-14 20:20:29 +02:00
parent e23a7585a7
commit c81d0e1222

View File

@ -353,7 +353,9 @@ class LeftAndMain extends Controller implements PermissionProvider {
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);