Skip to content

Commit b06ca3a

Browse files
committed
Fixed test failure
1 parent 05ebdcf commit b06ca3a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Http/Http/src/Features/QueryFeature.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,9 @@ public IQueryCollection Query
6161
{
6262
get
6363
{
64-
if (_features.Collection == null)
64+
if (_features.Collection is null)
6565
{
66-
if (_parsedValues == null)
67-
{
68-
_parsedValues = QueryCollection.Empty;
69-
}
70-
return _parsedValues;
66+
return _parsedValues ?? QueryCollection.Empty;
7167
}
7268

7369
var current = HttpRequestFeature.QueryString;
@@ -211,6 +207,11 @@ public void Append(ReadOnlySpan<char> key, ReadOnlySpan<char> value = default)
211207
/// </summary>
212208
public void Append(string key, string value)
213209
{
210+
if (key.Length == 0)
211+
{
212+
return;
213+
}
214+
214215
if (_accumulator is null)
215216
{
216217
_accumulator = new AdaptiveCapacityDictionary<string, StringValues>(StringComparer.OrdinalIgnoreCase);

0 commit comments

Comments
 (0)