From e0ae00c52322ad91182e68da53c638b19b4ede9e Mon Sep 17 00:00:00 2001 From: uwaa Date: Thu, 14 Nov 2024 02:31:06 +0000 Subject: [PATCH] clean --- HTTP/Routing/FileEndpoint.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/HTTP/Routing/FileEndpoint.cs b/HTTP/Routing/FileEndpoint.cs index ce4269b..f82e953 100644 --- a/HTTP/Routing/FileEndpoint.cs +++ b/HTTP/Routing/FileEndpoint.cs @@ -89,7 +89,11 @@ public partial class FileEndpoint : RouterBase { mime = GuessMIMEType(fileInfo.Extension); } - return !File.Exists(assetPath) ? null : (HttpResponse)new HttpContent(mime, await File.ReadAllBytesAsync(assetPath)); + + if (!File.Exists(assetPath)) + return null; + + return new HttpContent(mime, await File.ReadAllBytesAsync(assetPath)); } ///