UDPATE
On a whim, I decided to load 4 font files into a font converter. I converted fontsfrom ttf to ttf and then tried. Everything works fine: Content-Type is set correctly and the X-Powered-By header is removed.
Weird
I am trying to change the mime type (Content Type header) of the .ttf file in web.config to IIS7.
Here is the staticContent section inside <system.webServer />:
<staticContent>
<remove fileExtension=".ttf" />
<mimeMap fileExtension=".ttf" mimeType="font/ttf" />
</staticContent>
Even with the above configuration, all .ttf files are sent using the / octetstream application.
I also have a customHeader section with the following:
<remove name="X-Powered-By" />
which successfully removes the header X-Powered-Byfor css, png, jpg, gif, ico, .aspx, .htm, .html, shtml and js files. This does NOT, however, work for .ttf.
Does anyone know what I'm doing wrong?
web.config :
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5" />
<providerOption name="WarnAsError" value="false" />
</compiler>
</compilers>
</system.codedom>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
<add name="X-UA-Compatible" value="chrome=1;IE=edge" />
</customHeaders>
</httpProtocol>
<modules>
<remove name="Session" />
<remove name="WindowsAuthentication" />
<remove name="FormsAuthentication" />
<remove name="PassportAuthentication" />
<remove name="RoleManager" />
<remove name="UrlAuthorization" />
<remove name="FileAuthorization" />
<remove name="AnonymousIdentification" />
<remove name="Profile" />
</modules>
<staticContent>
<remove fileExtension=".ttf" />
<mimeMap fileExtension=".ttf" mimeType="font/ttf" />
</staticContent>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v2.0.50727">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>