Skip to content

Commit

Permalink
bug #35714 [HttpClient] Correctly remove trace level options for Http…
Browse files Browse the repository at this point in the history
…Cache (aschempp)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Correctly remove trace level options for HttpCache

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

The `HttpCache` component allows to [configure a trace level](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php#L46). Due to the behavior of `CachingHttpClient`, options that are meant for the `HttpCache` must be unset before preparing the request. Currently these options can't be set, because `HttpClient` errors with invalid configuration options.

Commits
-------

618cd80 Correctly remove trace level options for HttpCache
  • Loading branch information
fabpot committed Feb 15, 2020
2 parents 9697e9d + 618cd80 commit f4e9293
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpClient/CachingHttpClient.php
Expand Up @@ -55,6 +55,8 @@ public function __construct(HttpClientInterface $client, StoreInterface $store,
unset($defaultOptions['allow_revalidate']);
unset($defaultOptions['stale_while_revalidate']);
unset($defaultOptions['stale_if_error']);
unset($defaultOptions['trace_level']);
unset($defaultOptions['trace_header']);

if ($defaultOptions) {
[, $this->defaultOptions] = self::prepareRequest(null, null, $defaultOptions, $this->defaultOptions);
Expand Down

0 comments on commit f4e9293

Please sign in to comment.