2

I am trying to enable CORS in .NET to get round Firefox policy on cross-domain resources (fontawesome in my case).

I've found this solution for Apache that I want to translate to .NET.

I've tried to follow these guidelines for the translation, but I got stuck.

This is the relevant bit I want to translate from the .htaccess file to my web.config file.

<FilesMatch "\.(ttf|otf|eot|woff)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>

Any help much appreciated.

Community
  • 1
  • 1
U r s u s
  • 6,680
  • 12
  • 50
  • 88

1 Answers1

1

CORS:


MIME

Though unsure about your sample above - they're font files? If so, could it just be MIME mapping in IIS (not CORS)?

<system.webServer>
     <staticContent>        
        <mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
        ...
    </staticContent>  
</system.webServer>

Hth...

EdSF
  • 11,753
  • 6
  • 42
  • 83