diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-05-07 20:11:32 +0100 |
|---|---|---|
| committer | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-05-07 20:11:32 +0100 |
| commit | dca02987106d0433ee4139fb380dd78d92921dae (patch) | |
| tree | 188cceec1055976c776b9d7d3f1fb99f673890ff /Jellyfin.Api/Controllers/TestsController.cs | |
| parent | 8b34f76b63dca54d59b4f3db2f5b485c32bd8e36 (diff) | |
changed
Diffstat (limited to 'Jellyfin.Api/Controllers/TestsController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/TestsController.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Jellyfin.Api/Controllers/TestsController.cs b/Jellyfin.Api/Controllers/TestsController.cs new file mode 100644 index 000000000..1d1e1899f --- /dev/null +++ b/Jellyfin.Api/Controllers/TestsController.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. + /// </summary> + public class TestsController : 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 + }; + } + } +} |
