Skip to content

Commit

Permalink
mark request as redirected
Browse files Browse the repository at this point in the history
  • Loading branch information
olegbaturin committed Sep 1, 2020
1 parent 913050f commit ce56731
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Io/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ public function onResponse(ResponseInterface $response, RequestInterface $reques
throw new ResponseException($response);
}

// save request to response
$response->request = $request;
// resolve our initial promise
return $response;
}
Expand All @@ -248,6 +250,8 @@ private function onResponseRedirect(ResponseInterface $response, RequestInterfac
$location = Uri::resolve($request->getUri(), $response->getHeaderLine('Location'));

$request = $this->makeRedirectRequest($request, $location);
// mark request as redirested
$request->redirected = true;
$this->progress('redirect', array($request));

if ($deferred->numRequests >= $this->maxRedirects) {
Expand Down

0 comments on commit ce56731

Please sign in to comment.