Content Security Policy: The page's settings blocked the loading of a resource

前端 未结 6 612
梦毁少年i
梦毁少年i 2020-11-30 01:44

I am using CAPTCHA on page load, but it is blocking because of some security reason.

I am facing this problem:

    Content Security Policy: The page\'s sett         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 01:58

    You have said you can only load scripts from your own site (self). You have then tried to load a script from another site (www.google.com) and, because you've restricted this, you can't. That's the whole point of Content Security Policy (CSP).

    You can change your first line to:

    
    

    Or, alternatively, it may be worth removing that line completely until you find out more about CSP. Your current CSP is pretty lax anyway (allowing unsafe-inline, unsafe-eval and a default-src of *), so it is probably not adding too much value, to be honest.

提交回复
热议问题