Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a39dd66

Browse filesBrowse files
Merge branch '5.4' into 6.4
* 5.4: [HttpClient] Fix empty hosts in option "resolve"
2 parents f7cd287 + b65ff9f commit a39dd66
Copy full SHA for a39dd66

File tree

1 file changed

+4
-6
lines changed
Filter options

1 file changed

+4
-6
lines changed

‎src/Symfony/Component/HttpClient/HttpClientTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/HttpClientTrait.php
+4-6Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,8 @@ private static function mergeDefaultOptions(array $options, array $defaultOption
208208
$options['resolve'] = [];
209209
foreach ($resolve as $k => $v) {
210210
if ('' === $v = (string) $v) {
211-
throw new InvalidArgumentException(sprintf('Option "resolve" for host "%s" cannot be empty.', $k));
212-
}
213-
if ('[' === $v[0] && ']' === substr($v, -1) && str_contains($v, ':')) {
211+
$v = null;
212+
} elseif ('[' === $v[0] && ']' === substr($v, -1) && str_contains($v, ':')) {
214213
$v = substr($v, 1, -1);
215214
}
216215

@@ -238,9 +237,8 @@ private static function mergeDefaultOptions(array $options, array $defaultOption
238237
if ($resolve = $defaultOptions['resolve'] ?? false) {
239238
foreach ($resolve as $k => $v) {
240239
if ('' === $v = (string) $v) {
241-
throw new InvalidArgumentException(sprintf('Option "resolve" for host "%s" cannot be empty.', $k));
242-
}
243-
if ('[' === $v[0] && ']' === substr($v, -1) && str_contains($v, ':')) {
240+
$v = null;
241+
} elseif ('[' === $v[0] && ']' === substr($v, -1) && str_contains($v, ':')) {
244242
$v = substr($v, 1, -1);
245243
}
246244

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.