Skip to content

Commit a2db7ef

Browse files
pbowyernicolas-grekas
authored andcommitted
[HttpClient] Encode and decode curly brackets {}
1 parent 8ad5708 commit a2db7ef

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

HttpClientTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,7 @@ private static function mergeQueryString(?string $queryString, array $queryArray
638638
'%5D' => ']',
639639
'%5E' => '^',
640640
'%60' => '`',
641-
'%7B' => '{',
642641
'%7C' => '|',
643-
'%7D' => '}',
644642
]);
645643
}
646644

Tests/HttpClientTraitTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ public static function provideResolveUrl(): array
7070
[self::RFC3986_BASE, '/g', 'http://a/g'],
7171
[self::RFC3986_BASE, '//g', 'http://g/'],
7272
[self::RFC3986_BASE, '?y', 'http://a/b/c/d;p?y'],
73+
[self::RFC3986_BASE, '?y={"f":1}', 'http://a/b/c/d;p?y={%22f%22:1}'],
74+
[self::RFC3986_BASE, 'g{oof}y', 'http://a/b/c/g{oof}y'],
7375
[self::RFC3986_BASE, 'g?y', 'http://a/b/c/g?y'],
7476
[self::RFC3986_BASE, '#s', 'http://a/b/c/d;p?q#s'],
7577
[self::RFC3986_BASE, 'g#s', 'http://a/b/c/g#s'],
@@ -154,10 +156,11 @@ public static function provideParseUrl(): iterable
154156
yield [['https:', '//xn--dj-kia8a.example.com:8000', '/', null, null], 'https://DÉjà.Example.com:8000/'];
155157
yield [[null, null, '/f%20o.o', '?a=b', '#c'], '/f o%2Eo?a=b#c'];
156158
yield [[null, '//a:b@foo', '/bar', null, null], '//a:b@foo/bar'];
159+
yield [[null, '//a:b@foo', '/b{}', null, null], '//a:b@foo/b{}'];
157160
yield [['http:', null, null, null, null], 'http:'];
158161
yield [['http:', null, 'bar', null, null], 'http:bar'];
159162
yield [[null, null, 'bar', '?a=1&c=c', null], 'bar?a=a&b=b', ['b' => null, 'c' => 'c', 'a' => 1]];
160-
yield [[null, null, 'bar', '?a=b+c&b=b-._~!$%26/%27()[]*%2B%2C;%3D:@%25\\^`{|}', null], 'bar?a=b+c', ['b' => 'b-._~!$&/\'()[]*+,;=:@%\\^`{|}']];
163+
yield [[null, null, 'bar', '?a=b+c&b=b-._~!$%26/%27()[]*%2B%2C;%3D:@%25\\^`%7B|%7D', null], 'bar?a=b+c', ['b' => 'b-._~!$&/\'()[]*+,;=:@%\\^`{|}']];
161164
yield [[null, null, 'bar', '?a=b%2B%20c', null], 'bar?a=b+c', ['a' => 'b+ c']];
162165
yield [[null, null, 'bar', '?a[b]=c', null], 'bar', ['a' => ['b' => 'c']]];
163166
yield [[null, null, 'bar', '?a[b[c]=d', null], 'bar?a[b[c]=d', []];

0 commit comments

Comments
 (0)