added search url encoding

This commit is contained in:
Fishandchips321 2026-03-02 18:08:55 +00:00
parent 6a47760cbf
commit cdbfb8c185
3 changed files with 7 additions and 2 deletions

View file

@ -1,5 +1,6 @@
using JellyGlass.Services;
using Microsoft.AspNetCore.Mvc;
using System.Web;
namespace JellyGlass.Controllers;
@ -19,7 +20,8 @@ public class SearchController : ControllerBase
[HttpGet]
public async Task<IActionResult> handleSearch([FromQuery] string searchTerm, string serverId)
{
var results = await _service.Search(searchTerm, serverId);
var decodedSearchTerm = HttpUtility.UrlDecode(searchTerm);
var results = await _service.Search(decodedSearchTerm, serverId);
return Ok(results);
}