Allow inline style attibute on element using Content Security Policy (CSP) |
09-22-2021, 09:44 PM
(This post was last modified: 09-23-2021, 07:53 AM by coderscvoen. Edit Reason: updated the background image path )
Hi, l need help with this. Am showing an image from the database (the image is in a folder while the path is stored in the database) on a slider. I have enabled Content Security Policy from the "Config/App.php" and everything is working fine except this. The image is not being displayed since am showing it as inline style. Was wondering how to allow inline styling in CSP. The example they gave in the documentation does not seem to cover this. Since this image is dynamic, i can't move it to an external style. Any assistance is appreciated.
PHP Code: <div class="single-slider hero-overly slider-height d-flex align-items-center" style=" Here is the css CSP part. PHP Code: $response->CSP->setDefaultSrc('self'); |
Welcome Guest, Not a member yet? Register Sign In |