|
|
@ -10,11 +10,18 @@ namespace Jellyfin.Server.Tests
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public static class UrlDecodeQueryFeatureTests
|
|
|
|
public static class UrlDecodeQueryFeatureTests
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
public static TheoryData<string, string> EmptyValueTest_TestData()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var data = new TheoryData<string, string>();
|
|
|
|
|
|
|
|
data.Add("e0a72cb2a2c7", "e0a72cb2a2c7"); // isn't encoded
|
|
|
|
|
|
|
|
data.Add("random+test", "random test"); // encoded
|
|
|
|
|
|
|
|
data.Add("random%20test", "random test"); // encoded
|
|
|
|
|
|
|
|
data.Add("++", " "); // encoded
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Theory]
|
|
|
|
[Theory]
|
|
|
|
[InlineData("e0a72cb2a2c7", "e0a72cb2a2c7")] // isn't encoded
|
|
|
|
[MemberData(nameof(EmptyValueTest_TestData))]
|
|
|
|
[InlineData("random+test", "random test")] // encoded
|
|
|
|
|
|
|
|
[InlineData("random%20test", "random test")] // encoded
|
|
|
|
|
|
|
|
[InlineData("++", " ")] // encoded
|
|
|
|
|
|
|
|
public static void EmptyValueTest(string query, string key)
|
|
|
|
public static void EmptyValueTest(string query, string key)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var dict = new Dictionary<string, StringValues>
|
|
|
|
var dict = new Dictionary<string, StringValues>
|
|
|
|