I have a tablefield created with string column that is configured to show HTML.
The purpose of this approach is to show an image in the column of the table..
public class BarcodeImageURLColumn extends AbstractStringColumn {
@Override
protected String getConfiguredHeaderText() {
return TEXTS.get("Barcode");
}
@Override
protected int getConfiguredWidth() {
return 100;
}
@Override
protected boolean getConfiguredHtmlEnabled() {
// TODO Auto-generated method stub
return true;
}
}
the row data of that field is filled in as follows
voucherRow.setBarcodeImageURL(HTML.img(voucher.getBarcodeImageURL()).toHtml());
when looking in the HTML, the following code appears to be generated
<div class="table-cell white-space-nowrap halign-left first" style="min-width: 100px; max-width: 100px; "><img src="https://our.file.server/barcodes/voucher/0018/901/270/0018901270187.jpeg"></div>
So normally this should be OK to show the image in the respective column, however it is not shown.
if I copy the above url of the image in the browser, it is nicely shown.
Investigating further I noticed the following in the console log :
2019-08-02 16:48:06,676 WARN [qtp660143728-17] org.eclipse.scout.rt.ui.html.csp.ContentSecurityPolicyReportHandler.handlePost(ContentSecurityPolicyReportHandler.java:74) - CSP-REPORT: {
"csp-report": {
"document-uri": "http:\/\/be0001c4439:8082\/?dl=outline-12600&i=customers",
"referrer": "",
"violated-directive": "img-src",
"effective-directive": "img-src",
"original-policy": "img-src 'self'; style-src 'self' 'unsafe-inline'; child-src *; default-src 'self'; report-uri csp-report; script-src 'self'; frame-src *",
"disposition": "enforce",
"blocked-uri": "https:\/\/rollbase.macintoshfashion.be.lan\/barcodes\/voucher\/0018\/901\/270\/0018901270187.jpeg",
"status-code": 200,
"script-sample": ""
}
as per the documentation on the csp i tried the following in config.properties :
scout.cspDirective[img-src]=*
This should allow all images from external resources. However the error remains the same.
I also tried
Anybody an idea how this can be solved ?
Kind regards
Tore