aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2021-06-07 23:07:59 +0200
committerGitHub <noreply@github.com>2021-06-07 23:07:59 +0200
commit93387ba235fc86861d4cf24c582f49fb33bb0787 (patch)
tree5917003d31cf18a4c31a18fd04ec8a9a6f30e749 /tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs
parent19a18899065aa2d50b0a989911a5f58a368b3b95 (diff)
parent147612f59bb5870f04197087e3d5fcd954061471 (diff)
Merge pull request #5990 from BaronGreenback/UrlDecoding
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs')
-rw-r--r--tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs33
1 files changed, 33 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..14f92f0d8
--- /dev/null
+++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs
@@ -0,0 +1,33 @@
+using System.Collections.Generic;
+using System.Linq;
+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
+ };
+ }
+ }
+}