{ $safeMethods =
['GET', 'HEAD', 'OPTIONS'
];
$requestMethod =
$request->
getMethod();
$modify['method'
] =
in_array($requestMethod,
$safeMethods) ?
$requestMethod : 'GET';
$modify['body'
] = '';
} $uri = self::
redirectUri($request,
$response,
$protocols);
if (isset($options['idn_conversion'
]) && ($options['idn_conversion'
] !== false
)) { $idnOptions =
($options['idn_conversion'
] === true
) ? \IDNA_DEFAULT :
$options['idn_conversion'
];
$uri = Utils::
idnUriConvert($uri,
$idnOptions);
} $modify['uri'
] =
$uri;
Psr7\Message::
rewindBody($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(''
);