Setting CORS for static files on ember-cli server

前端 未结 2 881
抹茶落季
抹茶落季 2020-12-11 18:56

How do I set CORS on requests for fonts files (or any other static resource) on the built in ember-cli server?

This is the error message just for reference:

2条回答
  •  自闭症患者
    2020-12-11 19:22

    Add the following to ENV in config/environment.js:

    module.exports = function(environment) {
        contentSecurityPolicyHeader: 'Content-Security-Policy',
        contentSecurityPolicy: {
          // ... other stuff here
          'font-src': "'self' http://some-domain:4200",
        },
    }
    

提交回复
热议问题