diff --git a/composer.json b/composer.json index 36e3d49c..091bfbc2 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "wildphp/wild-irc-bot", - "version": "2.0.1", + "version": "2.0.2", "description": "A modular IRC bot written in PHP", "type": "project", "require": { diff --git a/lib/WildPHP/API/Remote.php b/lib/WildPHP/API/Remote.php index 89a121b4..5886524f 100644 --- a/lib/WildPHP/API/Remote.php +++ b/lib/WildPHP/API/Remote.php @@ -38,7 +38,11 @@ public static function getUriHeaders($uri) throw new InvalidUriException($uri . ' is not a valid link'); $httpClient = new Client(); - $resource = $httpClient->head($uri); + $resource = $httpClient->head($uri, [ + 'allow_redirects' => true, + 'connect_timeout' => 2, + 'timeout' => 5 + ]); unset($httpClient); return $resource; @@ -100,6 +104,7 @@ public static function getUriBody($uri) $httpClient = new Client(); $resource = $httpClient->get($uri, [ + 'allow_redirects' => true, 'connect_timeout' => 2, 'timeout' => 5 ]);