More strings to MongoIds

Convert constructors into primary constructors

Simplified logic with use of ??, ??= and method groups

Cleaned up redundant conditional access qualifiers
This commit is contained in:
Chomp
2025-07-14 22:29:41 +01:00
parent 26afa19387
commit 040be2feaa
150 changed files with 482 additions and 631 deletions
@@ -6,14 +6,12 @@ namespace SPTarkov.Server.Core.Utils;
[Injectable]
public class HttpFileUtil(HttpServerHelper httpServerHelper)
{
protected HttpServerHelper _httpServerHelper = httpServerHelper;
public async Task SendFile(HttpResponse resp, string filePath)
{
var pathSlice = filePath.Split("/");
var mimePath = _httpServerHelper.GetMimeText(pathSlice[^1].Split(".")[^1]);
var mimePath = httpServerHelper.GetMimeText(pathSlice[^1].Split(".")[^1]);
var type = string.IsNullOrWhiteSpace(mimePath)
? _httpServerHelper.GetMimeText("txt")
? httpServerHelper.GetMimeText("txt")
: mimePath;
resp.Headers.Append("Content-Type", type);
await resp.SendFileAsync(filePath, CancellationToken.None);