#U4-2326 Added Try Catch for PlatformNotSupportedException
Signed-off-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
This commit is contained in:
committed by
Sebastiaan Janssen
parent
f386c9d024
commit
cf5624f377
@@ -431,9 +431,16 @@ namespace Umbraco.Web
|
||||
app.PreSendRequestHeaders += (sender, args) =>
|
||||
{
|
||||
var httpContext = ((HttpApplication)sender).Context;
|
||||
httpContext.Response.Headers.Remove("Server");
|
||||
//this doesn't normally work since IIS sets it but we'll keep it here anyways.
|
||||
httpContext.Response.Headers.Remove("X-Powered-By");
|
||||
try
|
||||
{
|
||||
httpContext.Response.Headers.Remove("Server");
|
||||
//this doesn't normally work since IIS sets it but we'll keep it here anyways.
|
||||
httpContext.Response.Headers.Remove("X-Powered-By");
|
||||
}
|
||||
catch (PlatformNotSupportedException ex)
|
||||
{
|
||||
// can't remove headers this way on IIS6 or cassini.
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user