From 06401ffa0d8ae98fa42c750847f97c3c291b06ae Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Tue, 8 Jun 2021 22:26:59 +0200 Subject: Fix duplicate keys causing an exception --- .../Controllers/EncoderController.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs') diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs index 14f92f0d8..c8ce58047 100644 --- a/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs @@ -29,5 +29,25 @@ namespace Jellyfin.Api.Controllers StatusCode = 200 }; } + + /// + /// Tests the url decoding. + /// + /// Parameters to echo back in the response. + /// An . + /// Information retrieved. + [HttpGet("UrlArrayDecode")] + [ProducesResponseType(StatusCodes.Status200OK)] + public ContentResult TestUrlArrayDecoding([FromQuery] Dictionary? @params = null) + { + return new ContentResult() + { + Content = (@params != null && @params.Count > 0) + ? string.Join("&", @params.Select(x => x.Key + "=" + string.Join(',', x.Value))) + : string.Empty, + ContentType = "text/plain; charset=utf-8", + StatusCode = 200 + }; + } } } -- cgit v1.2.3