title: Content Security Policy issue node js react
body: <p>I am working on a react project in node js. I have two external sources in my index.html as</p>
  <pre><code>&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>Beside that I have a post request to the server that still due to CSP, the connection is failed. The post request failure is:</p>
  <blockquote>
  <p>Refused to connect to 'localhost:3000/visitor' because it violates the
  following Content Security Policy directive: &quot;default-src 'self'&quot;.
  Note that 'connect-src' was not explicitly set, so 'default-src' is
  used as a fallback.</p>
  </blockquote>
  <p>For the external links I got some errors regarding to Content Security Policy which I show one of them in the below.</p>
  <blockquote>
  <p>Refused to load the script
  'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'
  because it violates the following Content Security Policy directive:
  &quot;script-src 'self'&quot;. Note that 'script-src-elem' was not explicitly
  set, so 'script-src' is used as a fallback.</p>
  </blockquote>
  <p>I did two strategies and none of the resolved my problem:</p>
  <ol>
  <li><p>meta data by pass :</p>
   
  </li>
  </ol>
  <p>above all the script tags in index.html to basically have open to load any type of external files via script tag but still I get the same error in the browser and such js files does not load in my app</p>
  <ol start="2">
  <li>In my node js I used helmet module as the below:</li>
  </ol>
  <pre><code>app.use(helmet({
  
    contentSecurityPolicy: false,
  
  }));
  </code></pre>
  <p>What should I do to fix this problem that does not let the application work correctly?</p>