Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
Fix timeout issues in Remote API
Browse files Browse the repository at this point in the history
Signed-off-by: Yoshi2889 <[email protected]>
  • Loading branch information
NanoSector committed Jan 3, 2016
1 parent b1b84ba commit 49b8a9d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
7 changes: 6 additions & 1 deletion lib/WildPHP/API/Remote.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -100,6 +104,7 @@ public static function getUriBody($uri)

$httpClient = new Client();
$resource = $httpClient->get($uri, [
'allow_redirects' => true,
'connect_timeout' => 2,
'timeout' => 5
]);
Expand Down

0 comments on commit 49b8a9d

Please sign in to comment.