Fix duplicate keys causing an exception

This commit is contained in:
Bond_009
2021-06-08 22:26:59 +02:00
parent b986cb57b7
commit 06401ffa0d
4 changed files with 45 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ namespace Jellyfin.Server.Tests
[InlineData("e0a72cb2a2c7", "e0a72cb2a2c7")] // isn't encoded
[InlineData("random+test", "random test")] // encoded
[InlineData("random%20test", "random test")] // encoded
[InlineData("++", " ")] // encoded
public static void EmptyValueTest(string query, string key)
{
var dict = new Dictionary<string, StringValues>
@@ -23,7 +24,7 @@ namespace Jellyfin.Server.Tests
var test = new UrlDecodeQueryFeature(new QueryFeature(new QueryCollection(dict)));
Assert.Single(test.Query);
var (k, v) = test.Query.First();
Assert.Equal(k, key);
Assert.Equal(key, k);
Assert.Empty(v);
}
}