[BrowserKit] Fix browser kit redirect with ports
This commit is contained in:
parent
e76561dbc0
commit
39973de230
|
@ -607,7 +607,7 @@ abstract class Client
|
|||
|
||||
private function updateServerFromUri($server, $uri)
|
||||
{
|
||||
$server['HTTP_HOST'] = parse_url($uri, PHP_URL_HOST);
|
||||
$server['HTTP_HOST'] = $this->extractHost($uri);
|
||||
$scheme = parse_url($uri, PHP_URL_SCHEME);
|
||||
$server['HTTPS'] = null === $scheme ? $server['HTTPS'] : 'https' == $scheme;
|
||||
unset($server['HTTP_IF_NONE_MATCH'], $server['HTTP_IF_MODIFIED_SINCE']);
|
||||
|
|
|
@ -484,11 +484,11 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
|||
$headers = array(
|
||||
'HTTP_HOST' => 'www.example.com:8080',
|
||||
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
|
||||
'HTTPS' => false
|
||||
'HTTPS' => false,
|
||||
'HTTP_REFERER' => 'http://www.example.com:8080/'
|
||||
);
|
||||
|
||||
$client = new TestClient();
|
||||
$client->followRedirects(false);
|
||||
$client->setNextResponse(new Response('', 302, array(
|
||||
'Location' => 'http://www.example.com:8080/redirected',
|
||||
)));
|
||||
|
|
Reference in New Issue