$host =
$request->
getHeader('X_FORWARDED_HOST'
);
if ($host !== null &&
$host ===
$shop->
getHost()) { // If the base path is null, set it to empty string. Otherwise the request will try to assemble the base path. On a reverse proxy setup with varnish this will fail on virtual URLs like /en
// The X-Forwarded-Host header is only set in such environments
if ($shop->
getBasePath() === null
) { $shop->
setBasePath(''
);
} $request->
setSecure($shop->
getSecure());
$request->
setBasePath($shop->
getBasePath());
$request->
setBaseUrl($shop->
getBaseUrl());
$request->
setHttpHost($shop->
getHost());
} $this->
validateShop($shop);
$this->
get(ShopRegistrationServiceInterface::
class)->
registerShop($shop);
} /**
* @return void
*/
public function onRouteShutdown(Enlight_Controller_EventArgs
$args) {