3
응답 헤더에서 서버 필드를 변경하는 HttpModule이 있습니다. 그러나 그것은 ASP.NET/IIS7 클래식 모드에서는 작동하지 않습니다. 응답 헤더의 서버 필드를 제거하거나 변경하기위한 솔루션은 무엇입니까?ASP.NET/IIS7 클래식 모드에서 HTTP 응답 헤더를 설정할 수 없습니다.
public class CloakHttpHeaderModule : IHttpModule
{
public void Init(HttpApplication app)
{
app.PreSendRequestHeaders += new EventHandler(context_PreSendRequestHeaders);
}
public void Dispose()
{
}
private void context_PreSendRequestHeaders(object sender, EventArgs e)
{
var context = ((HttpApplication)sender).Context;
context.Response.Headers.Set("Server", "Apache 2.0");
//HttpContext.Current.Response.Headers.Set("Server", "WSGIServer/0.1 Python/2.6.1");
}
}