$statusCode =
$response->
getStatusCode();
if ($statusCode == 303
|| ($statusCode <= 302 && !
$options['allow_redirects'
]['strict'
]) ) { $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'
]