Skip to content

Commit 0546b86

Browse files
authored
Fix ipify timeout issue (#3)
1 parent 3184606 commit 0546b86

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/PathGenerator.php

+3-7
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,13 @@ protected function joinPaths(): string
3232
}
3333
}
3434

35-
return preg_replace('#/+#', '/', join('/', $paths));
35+
return preg_replace('#/+#', '/', implode('/', $paths));
3636
}
3737

3838
protected function remoteHostEqualsLocalHost(string $remoteHost): bool
3939
{
40-
$ip = Http::get('https://api.ipify.org/?format=json')->json('ip');
40+
$publicIp = Http::get('https://api64.ipify.org?format=json')->json('ip');
4141

42-
if ($ip !== $remoteHost) {
43-
return false;
44-
}
45-
46-
return true;
42+
return $publicIp === $remoteHost;
4743
}
4844
}

0 commit comments

Comments
 (0)