Refactor app architecture and clean local artifacts

This commit is contained in:
AzuTear
2026-06-24 23:43:14 +02:00
parent 17134b3b82
commit fef1d36fe8
274 changed files with 37724 additions and 6065 deletions
+16
View File
@@ -0,0 +1,16 @@
namespace Backend.Common;
public static class RequestMetadataReader
{
public static RequestMetadata Read(HttpContext context) =>
new(ReadClientIp(context), ReadUserAgent(context));
public static string ReadClientIp(HttpContext context) =>
context.Connection.RemoteIpAddress?.ToString() ?? "unknown";
public static string ReadUserAgent(HttpContext context)
{
var value = context.Request.Headers.UserAgent.ToString().Trim();
return value.Length > 400 ? value[..400] : value;
}
}