2

I can't get font-awesome to display properly in firefox, even in localhost. I'm receiving a cross domain error, exactly what's reported here.

The solution to this problem is to add the following to .htaccess or directly to apache config:

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

But I'm hosting my app in Google App Engine, so how can y set the Access-Control-Allow-Origin in GAE?

Community
  • 1
  • 1
Mike
  • 1,296
  • 2
  • 15
  • 40

1 Answers1

1

If you're using Java, edit your appengine-web.xml file to include something like

<static-files>
  <include path="/my_static-files" >
    <http-header name="Access-Control-Allow-Origin" value="*" />
  </include>
</static-files>

Or to avoid potential security issues from using value=* as noted by @mabn.

<static-files>
  <include path="/my_static-files" >
    <http-header name="Access-Control-Allow-Origin" value="http://example.org" />
  </include>
</static-files>

If you're using Python, edit your app.yaml file to include something like

- url: /images
  static_dir: static/images
  http_headers:
    Access-Control-Allow-Origin: *

See Java app configuration of Python app configuration for more details and how to make it more specific to your configuration.

ToddR
  • 790
  • 6
  • 12
  • adding this header creates a security issue. do not do this. or at least specify hostname instead of "*" – mabn May 11 '13 at 17:28
  • @mabn Instead of downvoting the answer why didn't you just edit it? Also, this was correct for this specific question. The question was how to set Access-Control-Allow-Origin to '*'. I will edit to take into consideration your security note. – ToddR May 24 '13 at 20:40