From: | Ed |
---|---|
Date: | 10/14/24 10:37 AM |
Topic: | Show Unsafe Images |
Type: | General Discussions |
Post a follow up |
Curious to see if anyone else has a problem showing unsafe images when previewing an email from the daily report. In Chrome 129.0.6668/101 all images are broken when I click "Show Unsafe Images". Developer extension says: "Refused to load the image '<URL>' because it violates the following Content Security Policy directive: "img-src 'self' 'unsafe-inline' data:'" I'm not sure if this is a setting in my specific browser or if it's a larger issue. The explanation Chrome gives is here:
Let's break it down:
Possible Causes and Solutions:
Content-Security-Policy: img-src 'self' 'unsafe-inline' data: example.com;
Use code snippets with caution
Important Notes:
By carefully reviewing your CSP and ensuring that it allows the necessary image sources, you can resolve this error and load your images without issues. |
|
Top |
From: | Synametrics Support |
---|---|
Date: | 10/16/24 4:09 PM |
Topic: | Show Unsafe Images |
Type: | General Discussions |
Post a follow up |
Ed, Xeams adds a Content-Security-Policy header in the request, preventing browsers from loading foreign images. You can disable this feature using the following steps:
|
|
Top |
From: | Ed |
---|---|
Date: | 10/18/24 8:55 AM |
Topic: | Show Unsafe Images |
Type: | General Discussions |
Post a follow up |
OK, thanks for the sharing that. But I'm thinking that this setting should be set as it is normally and then when a user clicks the button "Show unsafe images" it should be turned of, otherwise the feature to view images is broken for anyone who uses Xeams. Am I understanding that correctly? |
|
Top |
From: | Ed |
---|---|
Date: | 10/18/24 9:21 AM |
Topic: | Show Unsafe Images |
Type: | General Discussions |
Post a follow up |
It also looks like you are setting the headers to add the image sources to allow them to be displayed, but it could be that the headers are not being set correctly. I have an email from Google with images that are located on www.gstatic.com and the Xeams response header look like this: Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' h**ps://www.gstatic.com ;script-src 'self' 'unsafe-inline' 'unsafe-eval' h**p://www.google.com h**ps://www.gstatic.com h**ps://cdn.jsdelivr.net; object-src 'none';base-uri 'self';img-src 'self' 'unsafe-inline' data: In this case the images are broken. When I modify the response header like this: Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' h**ps://www.gstatic.com Now the images are displayed correctly. I'm not a web developer, but I wonder if there is an error in the formatting of the response header that you are generating. |
|
Top |
From: | Ed |
---|---|
Date: | 10/18/24 9:32 AM |
Topic: | Show Unsafe Images |
Type: | General Discussions |
Post a follow up |
Sorry for all the posts, I found that by either removing ";img-src 'self' 'unsafe-inline" from the header and leaving everything else, the images are displayed correctly. Or optionally just adding h**ps://www.gstatic.com to the img-src section also works. So in summary we have the current head like this: default-src 'self' 'unsafe-inline' 'unsafe-eval' h**ps://www.gstatic.com ;script-src 'self' 'unsafe-inline' 'unsafe-eval' h**p://www.google.com h**ps://www.gstatic.com h**ps://cdn.jsdelivr.net; object-src 'none';base-uri 'self';img-src 'self' 'unsafe-inline' data: All images are broken. Modifying the header like this: default-src 'self' 'unsafe-inline' 'unsafe-eval' h**ps://www.gstatic.com ;script-src 'self' 'unsafe-inline' 'unsafe-eval' h**p://www.google.com h**ps://www.gstatic.com h**ps://cdn.jsdelivr.net; object-src 'none';base-uri 'self';img-src 'self' 'unsafe-inline' h**ps://www.gstatic.com data:
And now all the images are displayed correctly. |
|
Top |
From: | Ed |
---|---|
Date: | 10/25/24 8:21 AM |
Topic: | Show Unsafe Images |
Type: | General Discussions |
Post a follow up |
Can you please comment if you believe the email preview is currently working as expected? My expectation is that if you have a button labeled "Show Unsafe Images", that it would in fact show the images and not show broken images in the preview. In previous versions this was the behavior. I have identified the headers and the changes that I believe are needed to function as expected. If there is no plan to implement this change, then it would be nice to know, so I can modify the server.properties file. If you acknowledge that this is a problem that will be fixed, then I will wait for the fix.
Thanks |
|
Top |
From: | Synametrics Support |
---|---|
Date: | 10/28/24 9:29 AM |
Topic: | Show Unsafe Images |
Type: | General Discussions |
Post a follow up |
Ed, You are correct. Xeams should remove this header before unsafe images are displayed. We have marked this for a future release.
|
|
Top |