mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Only set X-Pjax header in redirections if it doesn't already exist in the response
This commit is contained in:
parent
e23a7585a7
commit
c81d0e1222
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user