From 46c1f6fcf4b823d6563638ff72d4a48b081f34e9 Mon Sep 17 00:00:00 2001 From: Colin Stewart Date: Mon, 11 Sep 2023 10:31:22 +0000 Subject: [PATCH] External Libraries: Update the Requests library to version 2.0.8. This is a maintenance release with minor changes: - Only force close cURL connection when needed (cURL < 7.22). References: - [https://github.com/WordPress/Requests/releases/tag/v2.0.8 Requests 2.0.8 release notes] - [https://github.com/WordPress/Requests/compare/v2.0.6...v2.0.8 Full list of changes in Requests 2.0.8] Follow-up to [54997], [55007], [55046], [55225], [55296], [55629]. Props jrf, mukesh27, spacedmonkey, costdev. Fixes #59322. git-svn-id: https://develop.svn.wordpress.org/trunk@56554 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/Requests/src/Requests.php | 2 +- src/wp-includes/Requests/src/Transport/Curl.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/Requests/src/Requests.php b/src/wp-includes/Requests/src/Requests.php index 287bacaaa5..edf37f2214 100644 --- a/src/wp-includes/Requests/src/Requests.php +++ b/src/wp-includes/Requests/src/Requests.php @@ -148,7 +148,7 @@ class Requests { * * @var string */ - const VERSION = '2.0.6'; + const VERSION = '2.0.8'; /** * Selected transport name diff --git a/src/wp-includes/Requests/src/Transport/Curl.php b/src/wp-includes/Requests/src/Transport/Curl.php index 7316987b5f..29034b25d5 100644 --- a/src/wp-includes/Requests/src/Transport/Curl.php +++ b/src/wp-includes/Requests/src/Transport/Curl.php @@ -25,6 +25,7 @@ use WpOrg\Requests\Utility\InputValidator; final class Curl implements Transport { const CURL_7_10_5 = 0x070A05; const CURL_7_16_2 = 0x071002; + const CURL_7_22_0 = 0x071600; /** * Raw HTTP data @@ -363,7 +364,7 @@ final class Curl implements Transport { $options['hooks']->dispatch('curl.before_request', [&$this->handle]); // Force closing the connection for old versions of cURL (<7.22). - if (!isset($headers['Connection'])) { + if ($this->version < self::CURL_7_22_0 && !isset($headers['Connection'])) { $headers['Connection'] = 'close'; }