Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.6k views
in Technique[技术] by (71.8m points)

javascript - Refused to load the script because is violates the following CSP directive

issue

Refused to load the script 'https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js' because it violates the following Content Security Policy directive: "script-src 'self'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

I used cdn to load axios, and I ran into the problem as shown in the picture, I tried several ways on stack over flow but it still didn't work. Can someone help me with this problem? Why is it blocking my Axios from running? I have the same problem with other cdn. I am using nodejs and pug


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...