YoastSEO_Vendor\GuzzleHttp
RedirectMiddleware::redirectUri() private Yoast 1.0
Set the appropriate URL on the request based on the location header
{} Это метод класса: RedirectMiddleware{}
Хуков нет.
Возвращает
UriInterface.
Использование
// private - только в коде основоного (родительского) класса $result = $this->redirectUri( \YoastSEO_Vendor\Psr\Http\Message\RequestInterface $request, \YoastSEO_Vendor\Psr\Http\Message\ResponseInterface $response, $protocols );
- $request(Requestчислоerface) (обязательный)
- $response(Responseчислоerface) (обязательный)
- $protocols(массив) (обязательный)
Код RedirectMiddleware::redirectUri() RedirectMiddleware::redirectUri Yoast 15.6.2
private function redirectUri(\YoastSEO_Vendor\Psr\Http\Message\RequestInterface $request, \YoastSEO_Vendor\Psr\Http\Message\ResponseInterface $response, array $protocols)
{
$location = \YoastSEO_Vendor\GuzzleHttp\Psr7\UriResolver::resolve($request->getUri(), new \YoastSEO_Vendor\GuzzleHttp\Psr7\Uri($response->getHeaderLine('Location')));
// Ensure that the redirect URI is allowed based on the protocols.
if (!\in_array($location->getScheme(), $protocols)) {
throw new \YoastSEO_Vendor\GuzzleHttp\Exception\BadResponseException(\sprintf('Redirect URI, %s, does not use one of the allowed redirect protocols: %s', $location, \implode(', ', $protocols)), $request, $response);
}
return $location;
}