mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
Fix duplicate keys causing an exception
This commit is contained in:
@@ -20,6 +20,8 @@ namespace Jellyfin.Server.Integration.Tests
|
||||
[InlineData("a=1&b=2&c=3", "a=1&b=2&c=3")] // won't be processed as there is more than 1.
|
||||
[InlineData("a=1", "a=1")] // won't be processed as it has a value
|
||||
[InlineData("a%3D1%26b%3D2%26c%3D3", "a=1&b=2&c=3")] // will be processed.
|
||||
[InlineData("a=b&a=c", "a=b")]
|
||||
[InlineData("a%3Db%26a%3Dc", "a=b")]
|
||||
public async Task Ensure_Decoding_Of_Urls_Is_Working(string sourceUrl, string unencodedUrl)
|
||||
{
|
||||
var client = _factory.CreateClient();
|
||||
@@ -29,5 +31,18 @@ namespace Jellyfin.Server.Integration.Tests
|
||||
string reply = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
Assert.Equal(unencodedUrl, reply);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("a=b&a=c", "a=b,c")]
|
||||
[InlineData("a%3Db%26a%3Dc", "a=b,c")]
|
||||
public async Task Ensure_Array_Decoding_Of_Urls_Is_Working(string sourceUrl, string unencodedUrl)
|
||||
{
|
||||
var client = _factory.CreateClient();
|
||||
|
||||
var response = await client.GetAsync("Encoder/UrlArrayDecode?" + sourceUrl).ConfigureAwait(false);
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
string reply = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
Assert.Equal(unencodedUrl, reply);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user