Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #36377 [HttpClient] Fix scoped client without query option config…
…uration (X-Coder264) This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] Fix scoped client without query option configuration | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | The `query` key default value is an [empty array](https://github.com/symfony/symfony/blob/v4.4.7/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php#L30) and because of that it is always set. Processing a configuration for a scoped HTTP client (which has a `scope` and does not have a `base_uri`) results in the configuration being invalid. The error message says that query parameters cannot be aplied to the base URI since it is not defined (which doesn't make sense since the query parameters don't exist because they are empty). Commits ------- a07578d [HttpClient] Fix scoped client without query option configuration
- Loading branch information
Showing
5 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...Bundle/Tests/DependencyInjection/Fixtures/php/http_client_scoped_without_query_option.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
$container->loadFromExtension('framework', [ | ||
'http_client' => [ | ||
'scoped_clients' => [ | ||
'foo' => [ | ||
'scope' => '.*', | ||
], | ||
], | ||
], | ||
]); |
16 changes: 16 additions & 0 deletions
16
...Bundle/Tests/DependencyInjection/Fixtures/xml/http_client_scoped_without_query_option.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:framework="http://symfony.com/schema/dic/symfony" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd | ||
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> | ||
|
||
<framework:config> | ||
<framework:http-client> | ||
<framework:scoped-client | ||
name="foo" | ||
scope=".*" | ||
/> | ||
</framework:http-client> | ||
</framework:config> | ||
</container> |
5 changes: 5 additions & 0 deletions
5
...Bundle/Tests/DependencyInjection/Fixtures/yml/http_client_scoped_without_query_option.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
framework: | ||
http_client: | ||
scoped_clients: | ||
foo: | ||
scope: '.*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters