We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d395731 + df02c39 commit 23a1e62Copy full SHA for 23a1e62
src/DnsConnector.php
@@ -35,6 +35,11 @@ public function connect($uri)
35
$host = trim($parts['host'], '[]');
36
$connector = $this->connector;
37
38
+ // skip DNS lookup / URI manipulation if this URI already contains an IP
39
+ if (false !== filter_var($host, FILTER_VALIDATE_IP)) {
40
+ return $connector->connect($uri);
41
+ }
42
+
43
return $this
44
->resolveHostname($host)
45
->then(function ($ip) use ($connector, $host, $parts) {
@@ -86,10 +91,6 @@ public function connect($uri)
86
91
87
92
private function resolveHostname($host)
88
93
{
89
- if (false !== filter_var($host, FILTER_VALIDATE_IP)) {
90
- return Promise\resolve($host);
- }
-
94
$promise = $this->resolver->resolve($host);
95
96
return new Promise\Promise(
0 commit comments