aboutsummaryrefslogtreecommitdiff
path: root/vendor/guzzlehttp/guzzle/src/Exception
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2024-10-10 16:01:54 +0000
committerAndrew Dolgov <fox@fakecake.org>2024-10-10 16:01:54 +0000
commit468f464b486e2ed0527cfd7e80113d37cdd4d07c (patch)
tree60b3243c3796d6a21a349ee7ae8e5c76d5d2717a /vendor/guzzlehttp/guzzle/src/Exception
parent7fafad2ac2466b9a17b802d9b29d10056b439e29 (diff)
parent124c4e254250ebac336392711b32dfd6fa3caef3 (diff)
Merge branch 'feature/guzzle-7.9.2' into 'master'
Update Guzzle to 7.9.2 See merge request tt-rss/tt-rss!70
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