Skip to content

Commit

Permalink
(chore): do not allow apis to talk to thegraph
Browse files Browse the repository at this point in the history
  • Loading branch information
markharding committed Jun 28, 2024
1 parent 976df95 commit c035856
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Core/Blockchain/Uniswap/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Minds\Core\Http;
use Minds\Core\Blockchain\Services\BlockFinder;
use Minds\Core\Config\Config;
use Minds\Core\Router\Exceptions\ForbiddenException;
use Minds\Exceptions\ServerErrorException;

class Client
Expand Down Expand Up @@ -264,6 +265,10 @@ public function getTokenUsdPrices(string $tokenAddress): array
*/
private function request($query, $variables): array
{
if (php_sapi_name() !== 'cli') {
return new ForbiddenException(); // Only CLI can call for now
}

$graphqlEndpoint = $this->config->get('uniswap')['url'];

$response = $this->http->post(
Expand Down

0 comments on commit c035856

Please sign in to comment.