$transformedServerVars =
array_merge( $request->server->
all(),
['REQUEST_URI' =>
rtrim($request->
getBaseUrl(), '/'
) .
$resolved['pathInfo'
]] );
$transformedRequest =
$request->
duplicate(null, null, null, null, null,
$transformedServerVars);
$transformedRequest->attributes->
set(self::SALES_CHANNEL_BASE_URL,
$baseUrl);
$transformedRequest->attributes->
set(self::SALES_CHANNEL_ABSOLUTE_BASE_URL,
rtrim($absoluteBaseUrl, '/'
));
$transformedRequest->attributes->
set( self::STOREFRONT_URL,
$transformedRequest->attributes->
get(self::SALES_CHANNEL_ABSOLUTE_BASE_URL
) .
$transformedRequest->attributes->
get(self::SALES_CHANNEL_BASE_URL
) );
$transformedRequest->attributes->
set(self::SALES_CHANNEL_RESOLVED_URI,
$resolved['pathInfo'
]);
$transformedRequest->attributes->
set(PlatformRequest::ATTRIBUTE_SALES_CHANNEL_ID,
$salesChannel['salesChannelId'
]);
$transformedRequest->attributes->
set(SalesChannelRequest::ATTRIBUTE_IS_SALES_CHANNEL_REQUEST, true
);