diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-05-15 20:24:41 +0100 |
|---|---|---|
| committer | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-05-15 20:24:41 +0100 |
| commit | 53bfe0e77de6b3d9e8bb4b9740c8fbe009b145c5 (patch) | |
| tree | c961c2c0f64076273938ad53ee2fc9aea7774e9f /tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs | |
| parent | d0bfb56d2ef0607b10d83706f7ec76fc16bb4cf9 (diff) | |
Changes as requested
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs')
| -rw-r--r-- | tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs new file mode 100644 index 000000000..98ea00de6 --- /dev/null +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; +using System.Linq; +using Jellyfin.Api.Constants; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace Jellyfin.Api.Controllers +{ + /// <summary> + /// Controller for testing the encoded url. + /// </summary> + public class EncoderController : BaseJellyfinApiController + { + /// <summary> + /// Tests the url decoding. + /// </summary> + /// <param name="params">Parameters to echo back in the response.</param> + /// <returns>An <see cref="OkResult"/>.</returns> + /// <response code="200">Information retrieved.</response> + [HttpGet("UrlDecode")] + [ProducesResponseType(StatusCodes.Status200OK)] + public ContentResult TestUrlDecoding([FromQuery]Dictionary<string, string>? @params = null) + { + return new ContentResult() + { + Content = (@params != null && @params.Count > 0) + ? string.Join("&", @params.Select(x => x.Key + "=" + x.Value)) + : string.Empty, + ContentType = "text/plain; charset=utf-8", + StatusCode = 200 + }; + } + } +} |
