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