0

I am trying to render an image in pug that is hosted elsewhere on the web, not as a static asset in my project. I can navigate to it fine and pull it up in my browser, but when I load my webpage it gives me the error in the console

Refused to load the image '<URL>' because it violates the following Content Security Policy directive: "img-src 'self' data:".

I am trying to render the image as:

img.picture(src='https://somedomain.com/picture' alt='Some Picture')
Matt
  • 478
  • 4
  • 14
  • Have you tried running the page as static HTML? This doesn't look like a Pug error to me – Sandy Gifford Jan 31 '21 at 00:28
  • Just configure `helmet.contentSecurityPolicy(options)` in the [Helmet](https://helmetjs.github.io/#reference) - add `https://somedomain.com` into `img-src` directive. – granty Feb 02 '21 at 12:00

0 Answers0