diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2021-06-09 10:23:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-09 10:23:29 +0200 |
| commit | d366fd3fd7b9db8ce5f481f9f1093adc1018b04e (patch) | |
| tree | 0ba34f7139b2589379fca0127e2876799bd7dbae /tests/Jellyfin.Server.Integration.Tests/EncodedQueryStringTest.cs | |
| parent | b986cb57b7a73236f5a3a1ed22ee8233bd0c75a8 (diff) | |
| parent | 06401ffa0d8ae98fa42c750847f97c3c291b06ae (diff) | |
Merge pull request #6165 from Bond-009/tests4
Fix duplicate keys causing an exception
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/EncodedQueryStringTest.cs')
| -rw-r--r-- | tests/Jellyfin.Server.Integration.Tests/EncodedQueryStringTest.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/EncodedQueryStringTest.cs b/tests/Jellyfin.Server.Integration.Tests/EncodedQueryStringTest.cs index 29d3fe33d..732b4f050 100644 --- a/tests/Jellyfin.Server.Integration.Tests/EncodedQueryStringTest.cs +++ b/tests/Jellyfin.Server.Integration.Tests/EncodedQueryStringTest.cs @@ -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); + } } } |
