Clue\React\Buzz\Io\Transaction::onResponseRedirect PHP Метод

onResponseRedirect() приватный Метод

private onResponseRedirect ( Psr\Http\Message\ResponseInterface $response, Psr\Http\Message\RequestInterface $request )
$response Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\RequestInterface
    private function onResponseRedirect(ResponseInterface $response, RequestInterface $request)
    {
        // resolve location relative to last request URI
        $location = $this->messageFactory->uriRelative($request->getUri(), $response->getHeaderLine('Location'));
        // naïve approach..
        $method = $request->getMethod() === 'HEAD' ? 'HEAD' : 'GET';
        $request = $this->messageFactory->request($method, $location);
        $this->progress('redirect', array($request));
        if ($this->numRequests >= $this->maxRedirects) {
            throw new \RuntimeException('Maximum number of redirects (' . $this->maxRedirects . ') exceeded');
        }
        return $this->next($request);
    }