diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-05-07 14:37:26 +0100 |
|---|---|---|
| committer | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-05-07 14:37:26 +0100 |
| commit | af1fe1af6fee7f4e5cf73d92266df21b291169d9 (patch) | |
| tree | 9c14b889e6c83648b530c4b2b2d24317b08bb9bb /Jellyfin.Api/Controllers/TestController.cs | |
| parent | 4f5c9e95041a39ae549bfa3f36bbeda054bce3ca (diff) | |
Moved into test controller.
Diffstat (limited to 'Jellyfin.Api/Controllers/TestController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/TestController.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Jellyfin.Api/Controllers/TestController.cs b/Jellyfin.Api/Controllers/TestController.cs new file mode 100644 index 000000000..b76895696 --- /dev/null +++ b/Jellyfin.Api/Controllers/TestController.cs @@ -0,0 +1,41 @@ +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. + /// </summary> + [Route("Tests")] + public class TestController : BaseJellyfinApiController + { + /// <summary> + /// Initializes a new instance of the <see cref="TestController"/> class. + /// </summary> + public TestController() + { + } + + /// <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("Decoding", Name = "TestUrlDecoding")] + [ProducesResponseType(StatusCodes.Status200OK)] + public ActionResult TestUrlDecoding([FromQuery]Dictionary<string, string>? @params = null) + { + if (@params != null && @params.Count > 0) + { + Response.Headers.Add("querystring", string.Join("&", @params.Select(x => x.Key + "=" + x.Value))); + } + + return Ok(); + } + } +} |
