Font Awesome error: downloadable font: rejected by sanitizer

34,914

Solution 1

Remove the ?v=4.6.3 and remaining tail from this block (font-awesome.css / font-awesome.min.css).

@font-face {
  font-family: 'FontAwesome';
  src: url('../fonts/fontawesome-webfont.eot?v=4.6.3');
  src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'), 
  url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'),
  url('../fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'),
  url('../fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'), 
  url('../fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');
  font-weight: normal;

Updated to:

@font-face {
  font-family: 'FontAwesome';
  src: url('../fonts/fontawesome-webfont.eot');
  src: url('../fonts/fontawesome-webfont.eot') format('embedded-opentype'), 
  url('../fonts/fontawesome-webfont.woff2') format('woff2'), 
  url('../fonts/fontawesome-webfont.woff') format('woff'), 
  url('../fonts/fontawesome-webfont.ttf') format('truetype'), 
  url('../fonts/fontawesome-webfont.svg') format('svg');
  font-weight: normal;
  font-style: normal;
}

Solution 2

Catched !! Solved with replacing

font-family: 'fontawesome-webfont';

instead of

font-family: 'FontAwesome';

I works for me.

Solution 3

If you are getting the error fontawesome-webfont.woff2?v=4.6.3 not found but you definitely know you have the file, here is how to fix it in IIS:

You need to add the mime type in the config file for woff2.

<system.webServer>
<staticContent>
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />
</staticContent>
</system.webServer>

Solution 4

In my case I had a problem with a SVG loader (either vue-svg-loader or nuxt-svg-loader) that ended up converting the font URL into an object resulting in something like this:

@font-face{
    font-family:fontello;
    ...
    src:url([object object]) format("svg");
}
Share:
34,914
Amit Shah
Author by

Amit Shah

A Full-Stack Web Developer with PHP as backend skill set on LAMP platform, and Front-end HTML, JavaScript, CSS, JQuery, Angular, React etc.

Updated on August 13, 2021

Comments

  • Amit Shah
    Amit Shah almost 3 years

    downloadable font: rejected by sanitizer (font-family: "FontAwesome" style:normal weight:normal stretch:normal src index:1) source: http://192.168.1.254/theme/font-awesome/fonts/fontawesome-webfont.woff2?v=4.6.3 http://192.168.1.254/theme/font-awesome/css/font-awesome.min.css Line 4

    I was keep getting above error. and i tried lots of stuff found on the internet. (hosting the fonts on own server)

    • CORS issue
    • MIME-type header config in web server

    Other combinations of HTTP headers and MIME-types everything that can resolve the issue but nothing solved it.

  • Amit Shah
    Amit Shah almost 8 years
    @mayaa, in my case it was due to; my web server was not accepting/expecting any attached parameters (using GET, but using POST i don't know) with the above url calls.
  • Greg
    Greg about 7 years
    I saw errors in Chrome, such as iis returning 404.htm related to some of these file fontawesome related requests until making this change
  • GigaKatowice
    GigaKatowice over 4 years
    Your answer did the trick! I got this error on IIS 8 (W2012) but on IIS 10 (w2016) everything works fine.