aboutsummaryrefslogtreecommitdiff
path: root/vendor/guzzlehttp/guzzle/src/Exception
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/guzzlehttp/guzzle/src/Exception')
-rw-r--r--vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php2
-rw-r--r--vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php2
-rw-r--r--vendor/guzzlehttp/guzzle/src/Exception/RequestException.php28
3 files changed, 8 insertions, 24 deletions
diff --git a/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
index a80956c9d..ba67ad498 100644
--- a/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
+++ b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
@@ -14,7 +14,7 @@ class BadResponseException extends RequestException
string $message,
RequestInterface $request,
ResponseInterface $response,
- \Throwable $previous = null,
+ ?\Throwable $previous = null,
array $handlerContext = []
) {
parent::__construct($message, $request, $response, $previous, $handlerContext);
diff --git a/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php b/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php
index e1a31519c..eab51ca17 100644
--- a/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php
+++ b/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php
@@ -25,7 +25,7 @@ class ConnectException extends TransferException implements NetworkExceptionInte
public function __construct(
string $message,
RequestInterface $request,
- \Throwable $previous = null,
+ ?\Throwable $previous = null,
array $handlerContext = []
) {
parent::__construct($message, 0, $previous);
diff --git a/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php b/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
index c2d0a9ccc..b42c88abf 100644
--- a/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
+++ b/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
@@ -7,7 +7,6 @@ use GuzzleHttp\BodySummarizerInterface;
use Psr\Http\Client\RequestExceptionInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
-use Psr\Http\Message\UriInterface;
/**
* HTTP Request exception
@@ -32,8 +31,8 @@ class RequestException extends TransferException implements RequestExceptionInte
public function __construct(
string $message,
RequestInterface $request,
- ResponseInterface $response = null,
- \Throwable $previous = null,
+ ?ResponseInterface $response = null,
+ ?\Throwable $previous = null,
array $handlerContext = []
) {
// Set the code of the exception if the response is set and not future.
@@ -63,10 +62,10 @@ class RequestException extends TransferException implements RequestExceptionInte
*/
public static function create(
RequestInterface $request,
- ResponseInterface $response = null,
- \Throwable $previous = null,
+ ?ResponseInterface $response = null,
+ ?\Throwable $previous = null,
array $handlerContext = [],
- BodySummarizerInterface $bodySummarizer = null
+ ?BodySummarizerInterface $bodySummarizer = null
): self {
if (!$response) {
return new self(
@@ -90,8 +89,7 @@ class RequestException extends TransferException implements RequestExceptionInte
$className = __CLASS__;
}
- $uri = $request->getUri();
- $uri = static::obfuscateUri($uri);
+ $uri = \GuzzleHttp\Psr7\Utils::redactUserInfo($request->getUri());
// Client Error: `GET /` resulted in a `404 Not Found` response:
// <html> ... (truncated)
@@ -114,20 +112,6 @@ class RequestException extends TransferException implements RequestExceptionInte
}
/**
- * Obfuscates URI if there is a username and a password present
- */
- private static function obfuscateUri(UriInterface $uri): UriInterface
- {
- $userInfo = $uri->getUserInfo();
-
- if (false !== ($pos = \strpos($userInfo, ':'))) {
- return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***');
- }
-
- return $uri;
- }
-
- /**
* Get the request that caused the exception
*/
public function getRequest(): RequestInterface