function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ilayaraja PonnusamyIlayaraja Ponnusamy 

"localhost:port" ajax call from lightning component is not working

Hi,

I tried ajax call to the url "http://localhost:4060" from lightning component. it shows the below ERROR.

aura_prod.js:15 Refused to connect to 'http://localhost.4060/data' because it violates the following Content Security Policy directive: "connect-src 'self' https://api.bluetail.salesforce.com https://staging.bluetail.salesforce.com https://preprod.bluetail.salesforce.com http://localhost:4060 *.ap7.visual.force.com https://ap7.salesforce.com".

I've added the url in csp but still the same ERROR is there. And I see the url "http://localhost:4060" is converted to "http://localhost.4060"
the Colon is convert to dot at runtime.

need help to resolve this.