增加静态文件代理日志打印

This commit is contained in:
token
2024-01-29 14:26:53 +08:00
parent 7011029249
commit c8ce6e8a2e
@@ -35,6 +35,7 @@ public class StaticFileProxyMiddleware(IContentTypeProvider contentTypeProvider)
return;
}
// 设置响应头
foreach (var header in staticFileProxyEntity.ResponseHeaders)
{
@@ -49,6 +50,8 @@ public class StaticFileProxyMiddleware(IContentTypeProvider contentTypeProvider)
context.Request.Path = "/" + staticFileProxyEntity.Index;
}
Console.WriteLine($"静态文件代理:{staticFileProxyEntity.Path} -> {staticFileProxyEntity.Root} Path > {context.Request.Path} ");
// 拼接静态文件的完整路径
var fileInfo = new FileInfo(Path.Combine(staticFilePath,
context.Request.Path.Value?.TrimStart('/') ?? string.Empty));