问题标签 [asp.net-mvc-filters]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
115 浏览

c# - 如何在 .NET 5 的操作过滤器中手动 GZip 压缩 HttpResponse?

首先,我知道我可以只使用内置的中间件(即 app.UseResponseCompression();),但我必须这样做才能支持遗留应用程序。

这是 API 在使用 System.Web.Http.Filters 的旧 .NET 框架中使用的代码:

任何人都知道我如何使用 Microsoft.AspNetCore.Mvc.Filters 复制它?到目前为止,我有这个,无法弄清楚如何做实际的压缩部分。