remove headers

This commit is contained in:
Tommy Parnell
2015-08-09 15:44:40 -04:00
parent 5220ebc6db
commit 29560ae97b
2 changed files with 16 additions and 4 deletions

View File

@@ -25,11 +25,16 @@ namespace lmltfy
//Access the db to JIT the EF dll, and generate a URL to JIT parts of our DLL (improve page loads on subsequent first time app starts)
#if DEBUG
#else
//MvcHandler.DisableMvcResponseHeader = true;
// Console.WriteLine(azuredb.GetModelByKey("tdszzxr3").Brand);
MvcHandler.DisableMvcResponseHeader = true;
Console.WriteLine(azuredb.GetModelByKey("tdszzxr3").Brand);
#endif
}
protected void Application_PreSendRequestHeaders(object sender, EventArgs e)
{
HttpContext.Current.Response.Headers.Remove("X-Powered-By");
HttpContext.Current.Response.Headers.Remove("X-AspNet-Version");
}
}
}

View File

@@ -6,7 +6,7 @@
<configuration>
<connectionStrings>
<add name="AzureTable" connectionString="AzureTableConnectionStringHere" />
<add name="AzureTable" connectionString="AzureTableConnectionString" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
@@ -16,8 +16,9 @@
<add key="azureTableName" value="lmltfyDev" />
</appSettings>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="~/Error" />
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" enableVersionHeader="false" />
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.ApplicationInsightsHttpModule, Microsoft.ApplicationInsights.Extensibility.Web" />
</httpModules>
@@ -62,5 +63,11 @@
<remove name="ApplicationInsightsWebTracking" />
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.ApplicationInsightsHttpModule, Microsoft.ApplicationInsights.Extensibility.Web" preCondition="managedHandler" />
</modules>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
<remove name="X-AspNet-Version" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>