Closed
Description
Out of the box, Server
and X-Powered-By
headers are added to responses ...
Server:Microsoft-IIS/10.0
X-Powered-By:ASP.NET
I tried using an ActionFilterAttribute
to dump them ...
public class RemoveHeadersAttribute : ActionFilterAttribute {
public override void OnActionExecuted(ActionExecutedContext filterContext) {
filterContext.HttpContext.Response.Headers.Remove("Server");
filterContext.HttpContext.Response.Headers.Remove("X-Powered-By");
base.OnActionExecuted(filterContext);
}
}
... but only the Server
header was removed. Is the X-Powered-By
header added later in the pipeline? Can it be removed? btw--- Why are these added anyway ... to help MS (others?) track server and programming technology used on the Net?
Metadata
Metadata
Assignees
Labels
No labels