DEV Community

Anjaneyulu
Anjaneyulu

Posted on

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.

Top comments (1)

Collapse
 
anji484 profile image
Anjaneyulu

Any one please help on the above issue