"dragonmantank/cron-expression": "^3.3.2",
"erusev/parsedown": "^1.7.4",
"ezyang/htmlpurifier": "^4.16",
- "guzzlehttp/guzzle": "^7.5.1",
+ "guzzlehttp/guzzle": "^7.6.0",
"guzzlehttp/psr7": "^2.5.0",
"laminas/laminas-diactoros": "^3.0.0",
"laminas/laminas-httphandlerrunner": "^2.6.1",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "3890cea4bf52b36ef7c334e1bc964d5e",
+ "content-hash": "c7c064656bc3cb2982c96672ad21ed19",
"packages": [
{
"name": "cuyz/valinor",
},
{
"name": "guzzlehttp/guzzle",
- "version": "7.5.1",
+ "version": "7.6.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9"
+ "reference": "733dd89533dd371a0987172727df15f500dab0ef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b964ca597e86b752cd994f27293e9fa6b6a95ed9",
- "reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/733dd89533dd371a0987172727df15f500dab0ef",
+ "reference": "733dd89533dd371a0987172727df15f500dab0ef",
"shasum": ""
},
"require": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
- },
- "branch-alias": {
- "dev-master": "7.5-dev"
}
},
"autoload": {
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/7.5.1"
+ "source": "https://github.com/guzzle/guzzle/tree/7.6.0"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2023-04-17T16:30:08+00:00"
+ "time": "2023-05-14T11:23:39+00:00"
},
{
"name": "guzzlehttp/promises",
},
{
"name": "guzzlehttp/guzzle",
- "version": "7.5.1",
- "version_normalized": "7.5.1.0",
+ "version": "7.6.0",
+ "version_normalized": "7.6.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9"
+ "reference": "733dd89533dd371a0987172727df15f500dab0ef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b964ca597e86b752cd994f27293e9fa6b6a95ed9",
- "reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/733dd89533dd371a0987172727df15f500dab0ef",
+ "reference": "733dd89533dd371a0987172727df15f500dab0ef",
"shasum": ""
},
"require": {
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
"psr/log": "Required for using the Log middleware"
},
- "time": "2023-04-17T16:30:08+00:00",
+ "time": "2023-05-14T11:23:39+00:00",
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
- },
- "branch-alias": {
- "dev-master": "7.5-dev"
}
},
"installation-source": "dist",
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/7.5.1"
+ "source": "https://github.com/guzzle/guzzle/tree/7.6.0"
},
"funding": [
{
'dev_requirement' => false,
),
'guzzlehttp/guzzle' => array(
- 'pretty_version' => '7.5.1',
- 'version' => '7.5.1.0',
- 'reference' => 'b964ca597e86b752cd994f27293e9fa6b6a95ed9',
+ 'pretty_version' => '7.6.0',
+ 'version' => '7.6.0.0',
+ 'reference' => '733dd89533dd371a0987172727df15f500dab0ef',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
'aliases' => array(),
Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version.
+## 7.6.0 - 2023-05-14
+
+### Added
+
+- Support for setting the minimum TLS version in a unified way
+- Apply on request the version set in options parameters
+
+## 7.5.2 - 2023-05-14
+
+### Fixed
+
+- Fixed set cookie constructor validation
+- Fixed handling of files with `'0'` body
+
+### Changed
+
+- Corrected docs and default connect timeout value to 300 seconds
+
## 7.5.1 - 2023-04-17
### Fixed
"bamarni-bin": {
"bin-links": true,
"forward-command": false
- },
- "branch-alias": {
- "dev-master": "7.5-dev"
}
},
"autoload": {
}
}
+ if (isset($options['version'])) {
+ $modify['version'] = $options['version'];
+ }
+
$request = Psr7\Utils::modifyRequest($request, $modify);
if ($request->getBody() instanceof Psr7\MultipartStream) {
// Use a multipart/form-data POST if a Content-Type is not set.
*/
public function __construct(array $data = [])
{
- /** @var array|null $replaced will be null in case of replace error */
- $replaced = \array_replace(self::$defaults, $data);
- if ($replaced === null) {
- throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.');
+ $this->data = self::$defaults;
+
+ if (isset($data['Name'])) {
+ $this->setName($data['Name']);
+ }
+
+ if (isset($data['Value'])) {
+ $this->setValue($data['Value']);
+ }
+
+ if (isset($data['Domain'])) {
+ $this->setDomain($data['Domain']);
+ }
+
+ if (isset($data['Path'])) {
+ $this->setPath($data['Path']);
+ }
+
+ if (isset($data['Max-Age'])) {
+ $this->setMaxAge($data['Max-Age']);
+ }
+
+ if (isset($data['Expires'])) {
+ $this->setExpires($data['Expires']);
+ }
+
+ if (isset($data['Secure'])) {
+ $this->setSecure($data['Secure']);
+ }
+
+ if (isset($data['Discard'])) {
+ $this->setDiscard($data['Discard']);
+ }
+
+ if (isset($data['HttpOnly'])) {
+ $this->setHttpOnly($data['HttpOnly']);
+ }
+
+ // Set the remaining values that don't have extra validation logic
+ foreach (array_diff(array_keys($data), array_keys(self::$defaults)) as $key) {
+ $this->data[$key] = $data[$key];
}
- $this->data = $replaced;
// Extract the Expires value and turn it into a UNIX timestamp if needed
if (!$this->getExpires() && $this->getMaxAge()) {
// Calculate the Expires date
\CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
\CURLOPT_RETURNTRANSFER => false,
\CURLOPT_HEADER => false,
- \CURLOPT_CONNECTTIMEOUT => 150,
+ \CURLOPT_CONNECTTIMEOUT => 300,
];
if (\defined('CURLOPT_PROTOCOLS')) {
}
}
+ if (isset($options['crypto_method'])) {
+ if (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) {
+ if (!defined('CURL_SSLVERSION_TLSv1_0')) {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.0 not supported by your version of cURL');
+ }
+ $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_0;
+ } elseif (\STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method']) {
+ if (!defined('CURL_SSLVERSION_TLSv1_1')) {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.1 not supported by your version of cURL');
+ }
+ $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_1;
+ } elseif (\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method']) {
+ if (!defined('CURL_SSLVERSION_TLSv1_2')) {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL');
+ }
+ $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2;
+ } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) {
+ if (!defined('CURL_SSLVERSION_TLSv1_3')) {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL');
+ }
+ $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3;
+ } else {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided');
+ }
+ }
+
if (isset($options['cert'])) {
$cert = $options['cert'];
if (\is_array($cert)) {
$body = (string) $request->getBody();
- if (!empty($body)) {
+ if ('' !== $body) {
$context['http']['content'] = $body;
// Prevent the HTTP handler from adding a Content-Type header.
if (!$request->hasHeader('Content-Type')) {
}
}
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_crypto_method(RequestInterface $request, array &$options, $value, array &$params): void
+ {
+ if (
+ $value === \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
+ || $value === \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
+ || $value === \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
+ || (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && $value === \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT)
+ ) {
+ $options['http']['crypto_method'] = $value;
+
+ return;
+ }
+
+ throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided');
+ }
+
/**
* @param mixed $value as passed via Request transfer options.
*/
/**
* connect_timeout: (float, default=0) Float describing the number of
* seconds to wait while trying to connect to a server. Use 0 to wait
- * indefinitely (the default behavior).
+ * 300 seconds (the default behavior).
*/
public const CONNECT_TIMEOUT = 'connect_timeout';
+ /**
+ * crypto_method: (int) A value describing the minimum TLS protocol
+ * version to use.
+ *
+ * This setting must be set to one of the
+ * ``STREAM_CRYPTO_METHOD_TLS*_CLIENT`` constants. PHP 7.4 or higher is
+ * required in order to use TLS 1.3, and cURL 7.34.0 or higher is required
+ * in order to specify a crypto method, with cURL 7.52.0 or higher being
+ * required to use TLS 1.3.
+ */
+ public const CRYPTO_METHOD = 'crypto_method';
+
/**
* debug: (bool|resource) Set to true or set to a PHP stream returned by
* fopen() enable debug output with the HTTP handler used to send a