diff --git a/src/Gateway/Middlewares/StaticFileProxyMiddleware.cs b/src/Gateway/Middlewares/StaticFileProxyMiddleware.cs index 634558d..0d689be 100644 --- a/src/Gateway/Middlewares/StaticFileProxyMiddleware.cs +++ b/src/Gateway/Middlewares/StaticFileProxyMiddleware.cs @@ -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));