A CSP-related issue in react application.

anji484

Anjaneyulu

Posted on April 3, 2024

A CSP-related issue in react application.

Please look into the below steps that followed

  1. Created application using create-react-app
  2. For validating CSP used the ZAP tool, and got the below alerts

Image description

Above calls, we are not doing this from our application, it might be React Engine is calling these calls/API(s) internally.
Added the below code in the app.js file

Image description

we tried to append a response header to resolve the above ZAP tool issues but in the console getting an error “Error: TypeError: Failed to execute 'set' on 'Headers': Headers are immutable.” in the above code while sending a request set the header tried to set the same headers in response

Could you please anyone provide a solution to resolve this CSP-related issue?

Thanks,
Anjaneyulu.

💖 💪 🙅 🚩
anji484
Anjaneyulu

Posted on April 3, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related