@@ -334,7 +334,6 @@ public function test304()
334
334
public function testRedirects ()
335
335
{
336
336
$ client = $ this ->getHttpClient (__FUNCTION__ );
337
- $ localhost = gethostbyname ('localhost ' );
338
337
$ response = $ client ->request ('POST ' , 'http://localhost:8057/301 ' , [
339
338
'auth_basic ' => 'foo:bar ' ,
340
339
'body ' => function () {
@@ -352,7 +351,7 @@ public function testRedirects()
352
351
353
352
$ expected = [
354
353
'HTTP/1.1 301 Moved Permanently ' ,
355
- " Location: http:// $ localhost :8057/302 " ,
354
+ ' Location: http://127.0.0.1 :8057/302 ' ,
356
355
'Content-Type: application/json ' ,
357
356
'HTTP/1.1 302 Found ' ,
358
357
'Location: http://localhost:8057/ ' ,
@@ -425,7 +424,6 @@ public function testRedirect307()
425
424
public function testMaxRedirects ()
426
425
{
427
426
$ client = $ this ->getHttpClient (__FUNCTION__ );
428
- $ localhost = gethostbyname ('localhost ' );
429
427
$ response = $ client ->request ('GET ' , 'http://localhost:8057/301 ' , [
430
428
'max_redirects ' => 1 ,
431
429
'auth_basic ' => 'foo:bar ' ,
@@ -443,7 +441,7 @@ public function testMaxRedirects()
443
441
444
442
$ expected = [
445
443
'HTTP/1.1 301 Moved Permanently ' ,
446
- " Location: http:// $ localhost :8057/302 " ,
444
+ ' Location: http://127.0.0.1 :8057/302 ' ,
447
445
'Content-Type: application/json ' ,
448
446
'HTTP/1.1 302 Found ' ,
449
447
'Location: http://localhost:8057/ ' ,
@@ -692,9 +690,8 @@ public function testOnProgressError()
692
690
public function testResolve ()
693
691
{
694
692
$ client = $ this ->getHttpClient (__FUNCTION__ );
695
- $ localhost = gethostbyname ('localhost ' );
696
693
$ response = $ client ->request ('GET ' , 'http://symfony.com:8057/ ' , [
697
- 'resolve ' => ['symfony.com ' => $ localhost ],
694
+ 'resolve ' => ['symfony.com ' => ' 127.0.0.1 ' ],
698
695
]);
699
696
700
697
$ this ->assertSame (200 , $ response ->getStatusCode ());
@@ -708,16 +705,15 @@ public function testResolve()
708
705
public function testIdnResolve ()
709
706
{
710
707
$ client = $ this ->getHttpClient (__FUNCTION__ );
711
- $ localhost = gethostbyname ('localhost ' );
712
708
713
709
$ response = $ client ->request ('GET ' , 'http://0-------------------------------------------------------------0.com:8057/ ' , [
714
- 'resolve ' => ['0-------------------------------------------------------------0.com ' => $ localhost ],
710
+ 'resolve ' => ['0-------------------------------------------------------------0.com ' => ' 127.0.0.1 ' ],
715
711
]);
716
712
717
713
$ this ->assertSame (200 , $ response ->getStatusCode ());
718
714
719
715
$ response = $ client ->request ('GET ' , 'http://Bücher.example:8057/ ' , [
720
- 'resolve ' => ['xn--bcher-kva.example ' => $ localhost ],
716
+ 'resolve ' => ['xn--bcher-kva.example ' => ' 127.0.0.1 ' ],
721
717
]);
722
718
723
719
$ this ->assertSame (200 , $ response ->getStatusCode ());
@@ -885,7 +881,7 @@ public function testProxy()
885
881
886
882
$ body = $ response ->toArray ();
887
883
$ this ->assertSame ('localhost:8057 ' , $ body ['HTTP_HOST ' ]);
888
- $ this ->assertMatchesRegularExpression ('#^http://(localhost|127\.0\.\d+ \.1):8057/$# ' , $ body ['REQUEST_URI ' ]);
884
+ $ this ->assertMatchesRegularExpression ('#^http://(localhost|127\.0\.0 \.1):8057/$# ' , $ body ['REQUEST_URI ' ]);
889
885
890
886
$ response = $ client ->request ('GET ' , 'http://localhost:8057/ ' , [
891
887
'proxy ' => 'http://foo:b%3Dar@localhost:8057 ' ,
0 commit comments