Skip to content

Commit

Permalink
External Libraries: Update the Requests library to version 2.0.8.
Browse files Browse the repository at this point in the history
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]
- [WordPress/Requests@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
  • Loading branch information
costdev committed Sep 11, 2023
1 parent 2453a6b commit 46c1f6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/wp-includes/Requests/src/Requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class Requests {
*
* @var string
*/
const VERSION = '2.0.6';
const VERSION = '2.0.8';

/**
* Selected transport name
Expand Down
3 changes: 2 additions & 1 deletion src/wp-includes/Requests/src/Transport/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
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
Expand Down Expand Up @@ -363,7 +364,7 @@ private function setup_handle($url, $headers, $data, $options) {
$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';
}

Expand Down

0 comments on commit 46c1f6f

Please sign in to comment.