I have been trying to get rid of a number of CSP errors when I make a form submission but the number keep increasing. I thought I had handled the fav.icon error by directing express to the public folder in the front-end however it is still flagging with the default-src errors. On reading about default-src errors I also found into about a csp.json however when I added this the same errors have been showing. Where can I access the default-src or set this in React? i know fav.icon is the React logo so I am not so concerned about that but it looks really messy in my console and I am not sure if this causes problems elsewhere in my app.
CSP.JSON
{
"dev": {
"default-src": ["'self'"],
"style-src": [
"'self'",
"https://*.google.com"
]
},
"prod": {
"default-src": "'self'", // can be either a string or an array.
"style-src": [
"'self'"
],
"connect-src": [
"'self'",
"https://localhost:5002/"
]
}
}
backend showing express where my fav.icon file is
app.use(express.static('../WebApp/sustainable-scuba-web-app/public/'));
app.get("/favicon.ico", (req, res) => {
res.sendFile(path.resolve(__dirname, "/favicon.ico"));
});