-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Follow redirects * Rename retry request * Remove retryable interface * Refactor and update doc
- Loading branch information
Showing
20 changed files
with
475 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Jenky\Atlas\Exception; | ||
|
||
class TooManyRedirectsException extends \Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Jenky\Atlas; | ||
|
||
use Jenky\Atlas\Contracts\ConnectorInterface; | ||
use Jenky\Atlas\Middleware\FollowRedirects; | ||
use Jenky\Atlas\Traits\ConnectorDecoratorTrait; | ||
|
||
class FollowRedirectsConnector implements ConnectorInterface | ||
{ | ||
use ConnectorDecoratorTrait; | ||
|
||
public function __construct( | ||
ConnectorInterface $connector, | ||
int $max = 5, | ||
array $protocols = ['http', 'https'], | ||
bool $strict = false, | ||
bool $referer = false | ||
) { | ||
$clone = clone $connector; | ||
|
||
$clone->middleware() | ||
->unshift(new FollowRedirects( | ||
$max, $protocols, $strict, $referer | ||
)); | ||
|
||
$this->connector = $clone; | ||
} | ||
} |
Oops, something went wrong.