My problem is that I cannot view an image loaded from an external site into an img tag in my lightning component. The URL is with 'http' protocol not 'https', but when I see the Chrome Console, it tells that failed to load resource and I noticed that Salesforce try to go to the external site with the 'https' protocol and so it not find the resource. Why all this happens?


Try going to settings > search for Remote Site Settings, click New Remote Site > Give it a Name, type in the FULL URL of the image including the 'http://' BE SURE to check the box: Disable Protocol Security since this is not an 'https', make it active and try your image then Good luck!

  • I have several images to show. Can I only add the domain to the whitelist? Why you say to add the full URL? – CRK Oct 12 '18 at 13:22
  • Oh yes, sorry, just the domain works. I said FULL meaning include http – ryangreene Oct 12 '18 at 13:25
  • Also, if Remote Sites doesn't work you can try adding it to CSP Trusted Sites. CSP just doesn't give you the option of Disabling Protocol Security – ryangreene Oct 12 '18 at 13:26
  • I tried to add the domain to remote sites, but nothing changed. If it can be a plus, the component is shown into a community. Can this be a problem? – CRK Oct 12 '18 at 13:50
  • I have not used Community before, I am not sure if that's the issue. Have you tried other browsers? Any chance you get your HTTP site changed to HTTPS? – ryangreene Oct 12 '18 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.