‘img-src’ was not explicitly set, so ‘default-src’ is used as a fallback

So how can i enable setting img src dynamically ?

The problem is not setting the src, the problem is setting the src to a data: scheme URI.

Add data: to the list of things allowed by the content security policy. Either for the default-src or you could define a separate img-src.

In the example below, I have added img-src 'self' data:; to the start of the meta tag in the index.html file.

<meta http-equiv="Content-Security-Policy" content="img-src 'self' data:; default-src 'self' http://XX.XX.XX.XX:8084/mypp/">

Leave a Comment