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 ba42ed5

Browse filesBrowse files
committed
fix sending request to double slash path
1 parent 212de38 commit ba42ed5
Copy full SHA for ba42ed5

File tree

2 files changed

+13
-1
lines changed
Filter options

2 files changed

+13
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/BrowserKit/Client.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ protected function getAbsoluteUri($uri)
676676
}
677677

678678
// protocol relative URL
679-
if (str_starts_with($uri, '//')) {
679+
if ('//' !== $uri && str_starts_with($uri, '//')) {
680680
return parse_url($currentUri, \PHP_URL_SCHEME).':'.$uri;
681681
}
682682

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/BrowserKit/Tests/HttpBrowserTest.php
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,18 @@ public function testMultiPartRequestWithAdditionalParametersOfTheSameName()
172172
]);
173173
}
174174

175+
public function testDoubleForwardSlashRequestPath()
176+
{
177+
$client = $this->createMock(HttpClientInterface::class);
178+
$client
179+
->expects($this->once())
180+
->method('request')
181+
->with('GET', 'http://localhost//')
182+
->willReturn($this->createMock(ResponseInterface::class));
183+
$browser = new HttpBrowser($client);
184+
$browser->request('GET', '//');
185+
}
186+
175187
private function uploadFile(string $data): string
176188
{
177189
$path = tempnam(sys_get_temp_dir(), 'http');

0 commit comments

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