From ea7f1dd811adc5361b046d225a6d4c7a31f30b8d Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 9 Jan 2025 12:31:58 +0200 Subject: [PATCH] Use HTTP 1.1 protocol in ClientInterface implementing classes --- CHANGELOG.md | 3 ++- src/Jira/Api/Client/CurlClient.php | 1 + src/Jira/Api/Client/PHPClient.php | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d45588d..1949280 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). ... ### Fixed -... +- The `CurlClient` in combination with cURL version < 7.33.0 was getting `426 Upgrade Required` error on any request to the Atlassian Cloud servers by [@aik099] (#239). +- The `PHPClient` on PHP < 8.0 was getting `426 Upgrade Required` error on any request to the Atlassian Cloud servers by [@aik099] (#239). ## [2.0.0-B1] - 2025-01-04 ### Added diff --git a/src/Jira/Api/Client/CurlClient.php b/src/Jira/Api/Client/CurlClient.php index 2db41e6..8cfe505 100644 --- a/src/Jira/Api/Client/CurlClient.php +++ b/src/Jira/Api/Client/CurlClient.php @@ -93,6 +93,7 @@ public function sendRequest( curl_setopt($curl, CURLOPT_USERPWD, sprintf('%s:%s', $credential->getId(), $credential->getPassword())); } + curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($curl, CURLOPT_VERBOSE, $debug); diff --git a/src/Jira/Api/Client/PHPClient.php b/src/Jira/Api/Client/PHPClient.php index ea7c174..3124b8b 100644 --- a/src/Jira/Api/Client/PHPClient.php +++ b/src/Jira/Api/Client/PHPClient.php @@ -123,6 +123,7 @@ public function sendRequest( 'method' => $method, 'header' => implode("\r\n", $header), 'ignore_errors' => true, + 'protocol_version' => 1.1, // Not needed since PHP 8.0. ), );