Skip to content

Commit 259cb9c

Browse files
[HttpClient] fix requests to hosts that idn_to_ascii() cannot handle
1 parent 77fe934 commit 259cb9c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Test/HttpClientTestCase.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,23 @@ public function testResolve()
703703
$client->request('GET', 'http://symfony.com:8057/', ['timeout' => 1]);
704704
}
705705

706+
public function testIdnResolve()
707+
{
708+
$client = $this->getHttpClient(__FUNCTION__);
709+
710+
$response = $client->request('GET', 'http://0-------------------------------------------------------------0.com:8057/', [
711+
'resolve' => ['0-------------------------------------------------------------0.com' => '127.0.0.1'],
712+
]);
713+
714+
$this->assertSame(200, $response->getStatusCode());
715+
716+
$response = $client->request('GET', 'http://Bücher.example:8057/', [
717+
'resolve' => ['xn--bcher-kva.example' => '127.0.0.1'],
718+
]);
719+
720+
$this->assertSame(200, $response->getStatusCode());
721+
}
722+
706723
public function testNotATimeout()
707724
{
708725
$client = $this->getHttpClient(__FUNCTION__);

0 commit comments

Comments
 (0)