File tree 3 files changed +4
-17
lines changed 3 files changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -274,7 +274,7 @@ public function request(string $method, string $url, array $options = []): Respo
274
274
if (file_exists ($ options ['bindto ' ])) {
275
275
$ curlopts [\CURLOPT_UNIX_SOCKET_PATH ] = $ options ['bindto ' ];
276
276
} elseif (!str_starts_with ($ options ['bindto ' ], 'if! ' ) && preg_match ('/^(.*):(\d+)$/ ' , $ options ['bindto ' ], $ matches )) {
277
- $ curlopts [\CURLOPT_INTERFACE ] = $ matches [1 ];
277
+ $ curlopts [\CURLOPT_INTERFACE ] = trim ( $ matches [1 ], ' [] ' ) ;
278
278
$ curlopts [\CURLOPT_LOCALPORT ] = $ matches [2 ];
279
279
} else {
280
280
$ curlopts [\CURLOPT_INTERFACE ] = $ options ['bindto ' ];
Original file line number Diff line number Diff line change @@ -334,7 +334,9 @@ private static function dnsResolve($host, NativeClientState $multi, array &$info
334
334
$ info ['debug ' ] .= "* Hostname was NOT found in DNS cache \n" ;
335
335
$ now = microtime (true );
336
336
337
- if (!$ ip = gethostbynamel ($ host )) {
337
+ if ('[ ' === $ host [0 ] && '] ' === $ host [-1 ] && filter_var (substr ($ host , 1 , -1 ), \FILTER_VALIDATE_IP , \FILTER_FLAG_IPV6 )) {
338
+ $ ip = [$ host ];
339
+ } elseif (!$ ip = gethostbynamel ($ host )) {
338
340
throw new TransportException (sprintf ('Could not resolve host "%s". ' , $ host ));
339
341
}
340
342
Original file line number Diff line number Diff line change @@ -37,21 +37,6 @@ protected function getHttpClient(string $testCase): HttpClientInterface
37
37
return new CurlHttpClient (['verify_peer ' => false , 'verify_host ' => false ], 6 , 50 );
38
38
}
39
39
40
- public function testBindToPort ()
41
- {
42
- $ client = $ this ->getHttpClient (__FUNCTION__ );
43
- $ response = $ client ->request ('GET ' , 'http://localhost:8057 ' , ['bindto ' => '127.0.0.1:9876 ' ]);
44
- $ response ->getStatusCode ();
45
-
46
- $ r = new \ReflectionProperty ($ response , 'handle ' );
47
- $ r ->setAccessible (true );
48
-
49
- $ curlInfo = curl_getinfo ($ r ->getValue ($ response ));
50
-
51
- self ::assertSame ('127.0.0.1 ' , $ curlInfo ['local_ip ' ]);
52
- self ::assertSame (9876 , $ curlInfo ['local_port ' ]);
53
- }
54
-
55
40
public function testTimeoutIsNotAFatalError ()
56
41
{
57
42
if ('\\' === \DIRECTORY_SEPARATOR ) {
You can’t perform that action at this time.
<
10C5
template id="site-details-dialog">
0 commit comments