API: update x evitare svg nel name (calc e retrieve)

This commit is contained in:
Samuele Locatelli
2025-07-23 08:16:20 +02:00
parent 0cc9b90926
commit 10c203ec5f
7 changed files with 22 additions and 5 deletions
+12
View File
@@ -37,6 +37,12 @@ namespace Lux.API.Controllers
sw.Start();
string svgContent = "";
// se contiene ".svg" lo levo...
if (id.EndsWith(".svg"))
{
id = id.Replace(".svg", "");
}
// se messaggio vuoto --> uso default!
currJwd = string.IsNullOrEmpty(currJwd) ? demoJwd : currJwd;
@@ -99,6 +105,12 @@ namespace Lux.API.Controllers
if (string.IsNullOrEmpty(id))
return NotFound();
// se contiene ".svg" lo levo...
if (id.EndsWith(".svg"))
{
id = id.Replace(".svg", "");
}
string svgContent = await _imgService.LoadSvgAsync(id);
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(svgContent);