else { // Merge the default settings with the provided settings
$options['allow_redirects'
] += self::
$defaultSettings;
} if (empty($options['allow_redirects'
]['max'
])) { return $fn($request,
$options);
} return $fn($request,
$options) ->
then(function DResponseInterface
$response) use ($request,
$options) { return $this->
checkRedirect($request,
$options,
$response);
});
} /**
* @return ResponseInterface|PromiseInterface
*/
public function checkRedirect(RequestInterface
$request, array
$options, ResponseInterface
$response) { if (\
strpos((string) $response->
getStatusCode(), '3'
) !== 0
|| !
$response->
hasHeader('Location'
) ) {