7
我试图创建一个改变Response.Filter
像这样 (此演示只是设置过滤器回本身)一个的HttpModule:IIS 7.5 ASP.NET的HttpModule - 设置Response.Filter结果块编码
public class ContentTrafficMonitor : IHttpModule
{
public void Init(HttpApplication context)
{
context.BeginRequest += OnBeginRequest;
}
public void Dispose()
{
}
private static void OnBeginRequest(object sender, EventArgs e)
{
var application = (HttpApplication) sender;
application.Response.Filter = application.Response.Filter;
}
}
否则设置响应的传输编码分块到,而不是使用Content-Length
报头。
如果我删除设置了Response.Filter
的行,则响应的标头为Content-Length
。我们的应用程序取决于Content-Length
标题,有什么办法可以防止这种行为?
我也有这个问题。有没有人有任何解决办法? – Mahyar 2015-01-14 09:36:02