.NET Format Style Fixes
This commit is contained in:
@@ -12,7 +12,9 @@ public class HttpFileUtil(HttpServerHelper httpServerHelper)
|
||||
{
|
||||
var pathSlice = filePath.Split("/");
|
||||
var mimePath = _httpServerHelper.GetMimeText(pathSlice[^1].Split(".")[^1]);
|
||||
var type = string.IsNullOrWhiteSpace(mimePath) ? _httpServerHelper.GetMimeText("txt") : mimePath;
|
||||
var type = string.IsNullOrWhiteSpace(mimePath)
|
||||
? _httpServerHelper.GetMimeText("txt")
|
||||
: mimePath;
|
||||
resp.Headers.Append("Content-Type", type);
|
||||
await resp.SendFileAsync(filePath, CancellationToken.None);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user