8000 [BrowserKit] fixed headers when redirecting if history is set to fals… · fabpot/symfony@96a4b00 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 96a4b00

Browse files
committed
[BrowserKit] fixed headers when redirecting if history is set to false (refs symfony#8697)
1 parent 7e06905 commit 96a4b00

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Symfony/Component/BrowserKit/Client.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ abstract class Client
4040
protected $redirect;
4141
protected $followRedirects;
4242

43+
private $internalRequest;
44+
4345
/**
4446
* Constructor.
4547
*
@@ -250,7 +252,7 @@ public function request($method, $uri, array $parameters = array(), array $files
250252
$server['HTTP_HOST'] = parse_url($uri, PHP_URL_HOST);
251253
$server['HTTPS'] = 'https' == parse_url($uri, PHP_URL_SCHEME);
252254

253-
$request = new Request($uri, $method, $parameters, $files, $this->cookieJar->allValues($uri), $server, $content);
255+
$this->internalRequest = $request = new Request($uri, $method, $parameters, $files, $this->cookieJar->allValues($uri), $server, $content);
254256

255257
$this->request = $this->filterRequest($request);
256258

@@ -420,7 +422,9 @@ public function followRedirect()
420422
throw new \LogicException('The request was not redirected.');
421423
}
422424

423-
return $this->request('get', $this->redirect, array(), array(), $this->history->current()->getServer());
425+
$server = $this->internalRequest->getServer();
426+
427+
return $this->request('get', $this->redirect, array(), array(), $server);
424428
}
425429

426430
/**

0 commit comments

Comments
 (0)
0