Skip to content

Commit

Permalink
Fix ipify timeout issue (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni authored Jun 28, 2023
1 parent 3184606 commit 0546b86
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/PathGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,13 @@ protected function joinPaths(): string
}
}

return preg_replace('#/+#', '/', join('/', $paths));
return preg_replace('#/+#', '/', implode('/', $paths));
}

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

if ($ip !== $remoteHost) {
return false;
}

return true;
return $publicIp === $remoteHost;
}
}

0 comments on commit 0546b86

Please sign in to comment.