public function createRedirectResponse(Request
$request, string
$path, int
$status = 302
): RedirectResponse
{ if (null !==
$this->secureDomainRegexp && 'https' ===
$this->urlMatcher->
getContext()->
getScheme() &&
preg_match('#^https?:[/\\\\]{2,}+[^/]++#i',
$path,
$host) && !
preg_match(sprintf($this->secureDomainRegexp,
preg_quote($request->
getHttpHost())),
$host[0
])) { $path = '/';
} if (null !==
$this->domainRegexp &&
preg_match('#^https?:[/\\\\]{2,}+[^/]++#i',
$path,
$host) && !
preg_match(sprintf($this->domainRegexp,
preg_quote($request->
getHttpHost())),
$host[0
])) { $path = '/';
} return new RedirectResponse($this->
generateUri($request,
$path),
$status);
} /**
* Creates a Request.
*
* @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
*/
public function createRequest(Request
$request, string
$path): Request
{ $newRequest = Request::
create($this->
generateUri($request,
$path), 'get',
[],
$request->cookies->
all(),
[],
$request->server->
all());