Skip to content

Commit 47ed7b5

Browse files
[HttpClient] Add QUERY to the list of retriable HTTP methods
1 parent bd7c469 commit 47ed7b5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ CHANGELOG
44
7.4
55
---
66

7-
* Deprecate using amphp/http-client < 5
87
* Add RFC 9111–based caching support to `CachingHttpClient`
9-
* Deprecate passing an instance of `StoreInterface` as `$cache` argument to `CachingHttpClient` constructor
108
* Add option `auto_upgrade_http_version` to control how the request HTTP version is handled in `HttplugClient` and `Psr18Client`
9+
* Add QUERY to the list of retriable HTTP methods
10+
* Deprecate using amphp/http-client < 5
11+
* Deprecate passing an instance of `StoreInterface` as `$cache` argument to `CachingHttpClient` constructor
1112

1213
7.3
1314
---

Response/CurlResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function __construct(
7979

8080
if (!$info['response_headers']) {
8181
// Used to keep track of what we're waiting for
82-
curl_setopt($ch, \CURLOPT_PRIVATE, \in_array($method, ['GET', 'HEAD', 'OPTIONS', 'TRACE'], true) && 1.0 < (float) ($options['http_version'] ?? 1.1) ? 'H2' : 'H0'); // H = headers + retry counter
82+
curl_setopt($ch, \CURLOPT_PRIVATE, \in_array($method, ['GET', 'HEAD', 'OPTIONS', 'TRACE', 'QUERY'], true) && 1.0 < (float) ($options['http_version'] ?? 1.1) ? 'H2' : 'H0'); // H = headers + retry counter
8383
}
8484

8585
curl_setopt($ch, \CURLOPT_HEADERFUNCTION, static function ($ch, string $data) use (&$info, &$headers, $options, $multi, $id, &$location, $resolveRedirect, $logger): int {

Retry/GenericRetryStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class GenericRetryStrategy implements RetryStrategyInterface
2424
{
25-
public const IDEMPOTENT_METHODS = ['GET', 'HEAD', 'PUT', 'DELETE', 'OPTIONS', 'TRACE'];
25+
public const IDEMPOTENT_METHODS = ['GET', 'HEAD', 'PUT', 'DELETE', 'OPTIONS', 'TRACE', 'QUERY'];
2626
public const DEFAULT_RETRY_STATUS_CODES = [
2727
0 => self::IDEMPOTENT_METHODS, // for transport exceptions
2828
423,

0 commit comments

Comments
 (0)