WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

YoastSEO_Vendor\GuzzleHttp

RedirectMiddleware::modifyRequest() public Yoast 1.0

{} Это метод класса: RedirectMiddleware{}

Хуков нет.

Возвращает

RequestInterface.

Использование

$RedirectMiddleware = new RedirectMiddleware();
$RedirectMiddleware->modifyRequest( \YoastSEO_Vendor\Psr\Http\Message\RequestInterface $request, $options, \YoastSEO_Vendor\Psr\Http\Message\ResponseInterface $response );
$request(Requestчислоerface) (обязательный)
$options(массив) (обязательный)
$response(Responseчислоerface) (обязательный)

Код RedirectMiddleware::modifyRequest() Yoast 15.6.2

<?php
public function modifyRequest(\YoastSEO_Vendor\Psr\Http\Message\RequestInterface $request, array $options, \YoastSEO_Vendor\Psr\Http\Message\ResponseInterface $response)
{
    // Request modifications to apply.
    $modify = [];
    $protocols = $options['allow_redirects']['protocols'];
    // Use a GET request if this is an entity enclosing request and we are
    // not forcing RFC compliance, but rather emulating what all browsers
    // would do.
    $statusCode = $response->getStatusCode();
    if ($statusCode == 303 || $statusCode <= 302 && $request->getBody() && !$options['allow_redirects']['strict']) {
        $modify['method'] = 'GET';
        $modify['body'] = '';
    }
    $modify['uri'] = $this->redirectUri($request, $response, $protocols);
    \YoastSEO_Vendor\GuzzleHttp\Psr7\rewind_body($request);
    // Add the Referer header if it is told to do so and only
    // add the header if we are not redirecting from https to http.
    if ($options['allow_redirects']['referer'] && $modify['uri']->getScheme() === $request->getUri()->getScheme()) {
        $uri = $request->getUri()->withUserInfo('', '');
        $modify['set_headers']['Referer'] = (string) $uri;
    } else {
        $modify['remove_headers'][] = 'Referer';
    }
    // Remove Authorization header if host is different.
    if ($request->getUri()->getHost() !== $modify['uri']->getHost()) {
        $modify['remove_headers'][] = 'Authorization';
    }
    return \YoastSEO_Vendor\GuzzleHttp\Psr7\modify_request($request, $modify);
}