Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d9cf28d

Browse filesBrowse files
committed
fixed protocol-relative URLs
1 parent 289da16 commit d9cf28d
Copy full SHA for d9cf28d

File tree

2 files changed

+3
-2
lines changed
Filter options

2 files changed

+3
-2
lines changed

‎src/Symfony/Component/BrowserKit/Client.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/BrowserKit/Client.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ protected function requestFromRequest(Request $request, $changeHistory = true)
613613
private function updateServerFromUri($server, $uri)
614614
{
615615
$server['HTTP_HOST'] = parse_url($uri, PHP_URL_HOST);
616-
$server['HTTPS'] = 'https' == parse_url($uri, PHP_URL_SCHEME);
616+
$scheme = parse_url($uri, PHP_URL_SCHEME);
617+
$server['HTTPS'] = null === $scheme ? $server['HTTPS'] : 'https' == $scheme;
617618
unset($server['HTTP_IF_NONE_MATCH'], $server['HTTP_IF_MODIFIED_SINCE']);
618619

619620
return $server;

‎src/Symfony/Component/BrowserKit/Tests/ClientTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/BrowserKit/Tests/ClientTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ public function testFollowRedirectWithMaxRedirects()
399399
$this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows relative URLs');
400400

401401
$client = new TestClient();
402-
$client->setNextResponse(new Response('', 302, array('Location' => 'https://www.example.org/')));
402+
$client->setNextResponse(new Response('', 302, array('Location' => '//www.example.org/')));
403403
$client->request('GET', 'https://www.example.com/');
404404

405405
$this->assertEquals('https://www.example.org/', $client->getRequest()->getUri(), '->followRedirect() follows protocol-relative URLs');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.