2
0

TestController.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using Jellyfin.Api.Constants;
  4. using Microsoft.AspNetCore.Authorization;
  5. using Microsoft.AspNetCore.Http;
  6. using Microsoft.AspNetCore.Mvc;
  7. namespace Jellyfin.Api.Controllers
  8. {
  9. /// <summary>
  10. /// Controller for testing.
  11. /// </summary>
  12. public class TestsController : BaseJellyfinApiController
  13. {
  14. /// <summary>
  15. /// Tests the url decoding.
  16. /// </summary>
  17. /// <param name="params">Parameters to echo back in the response.</param>
  18. /// <returns>An <see cref="OkResult"/>.</returns>
  19. /// <response code="200">Information retrieved.</response>
  20. [HttpGet("UrlDecode")]
  21. [ProducesResponseType(StatusCodes.Status200OK)]
  22. public ActionResult TestUrlDecoding([FromQuery]Dictionary<string, string>? @params = null)
  23. {
  24. if (@params != null && @params.Count > 0)
  25. {
  26. Response.Headers.Add("querystring", string.Join("&", @params.Select(x => x.Key + "=" + x.Value)));
  27. }
  28. return Ok();
  29. }
  30. }
  31. }