using System.Collections.Generic; using System.Linq; 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 }; } } }