From 53bfe0e77de6b3d9e8bb4b9740c8fbe009b145c5 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sat, 15 May 2021 20:24:41 +0100 Subject: Changes as requested --- .../Controllers/EncoderController.cs | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs (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 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 +{ + /// + /// Controller for testing the encoded url. + /// + public class EncoderController : BaseJellyfinApiController + { + /// + /// Tests the url decoding. + /// + /// Parameters to echo back in the response. + /// An . + /// Information retrieved. + [HttpGet("UrlDecode")] + [ProducesResponseType(StatusCodes.Status200OK)] + public ContentResult TestUrlDecoding([FromQuery]Dictionary? @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 + }; + } + } +} -- cgit v1.2.3 From e71c10df46f80085bcae98dba821785f0cc6351a Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 7 Jun 2021 16:21:22 +0100 Subject: Update tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs Co-authored-by: Claus Vium --- .../Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs | 2 -- 1 file changed, 2 deletions(-) (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 98ea00de6..be9c13890 100644 --- a/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs @@ -1,7 +1,5 @@ using System.Collections.Generic; using System.Linq; -using Jellyfin.Api.Constants; -using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -- cgit v1.2.3 From 133ce65e2892ef0f5628c3dad7a0f49f4558812a Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 7 Jun 2021 16:21:30 +0100 Subject: Update tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs Co-authored-by: Claus Vium --- .../Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 be9c13890..14f92f0d8 100644 --- a/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs @@ -18,7 +18,7 @@ namespace Jellyfin.Api.Controllers /// Information retrieved. [HttpGet("UrlDecode")] [ProducesResponseType(StatusCodes.Status200OK)] - public ContentResult TestUrlDecoding([FromQuery]Dictionary? @params = null) + public ContentResult TestUrlDecoding([FromQuery] Dictionary? @params = null) { return new ContentResult() { -- cgit v1.2.3