mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Keep X-ControllerURL canonical by not re-constructing with question mark if there's no GET string (caused duplicate HTML5 pushState requests)
This commit is contained in:
parent
af80ab5ab7
commit
0414e42bbc
@ -332,7 +332,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
$url = $request->getURL();
|
$url = $request->getURL();
|
||||||
if($getVars = $request->getVars()) {
|
if($getVars = $request->getVars()) {
|
||||||
if(isset($getVars['url'])) unset($getVars['url']);
|
if(isset($getVars['url'])) unset($getVars['url']);
|
||||||
$url = Controller::join_links($url, '?' . http_build_query($getVars));
|
$url = Controller::join_links($url, $getVars ? '?' . http_build_query($getVars) : '');
|
||||||
}
|
}
|
||||||
$response->addHeader('X-ControllerURL', $url);
|
$response->addHeader('X-ControllerURL', $url);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user