ruby - How to serve fonts from public folder allowing "Access-Control-Allow-Origin" in rails? -


i have fonts folder in "public" folder. using font paths in css file like:

https://example.com/fonts/icomoon.eot?2p5wfs 

i having issue:

from origin 'null' has been blocked cors policy: no 'access-control-allow-origin' header present on requested resource. origin 'null' therefore not allowed access. 

it works if turn on chrome "cors" extension. how can load icons without using chrome extension?

try:

config.action_dispatch.default_headers = {     'access-control-allow-origin' => 'https://example.com',     'access-control-request-method' => %w{get post options}.join(",")   } 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -