Skip to content
This repository has been archived by the owner on Mar 29, 2019. It is now read-only.

Commit

Permalink
Request::DOWNLOAD method is preserved in redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
hranicka committed Oct 30, 2014
1 parent ae3ce10 commit 89294e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Kdyby/Curl/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ public function download($post = array())
final public function followRedirect(Response $response)
{
$request = clone $this;
$request->setMethod(Request::GET);
if (!$request->isMethod(Request::DOWNLOAD)) {
$request->setMethod(Request::GET);
}
$request->post = $request->files = array();
$request->cookies = $response->getCookies() + $request->cookies;
$request->setUrl(static::fixUrl($request->getUrl(), $response->headers['Location']));
Expand Down

0 comments on commit 89294e3

Please sign in to comment.