Replies: 1 comment
-
Has anyone managed to solve this problem? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In addition to laravel-medialibrary I'm utilizing the spatie/laravel-csp package and adhering to a strict CSP configuration. The issue arises with the responsive images feature of the media library. The generated
tags include an onload attribute containing inline JavaScript, which conflicts with my CSP settings -
The browser refuses to execute the inline script in the onload attribute, leading to CSP violation reports -
Ideally, I would like to avoid using 'unsafe-inline' in the script directive for security reasons.
Here's an example of an
<img>
tag generated by the media library:Could you please advise on a possible solution or workaround for this issue? Are there any configurations within the media library that I can leverage to either modify or remove the inline
onload
handler, or to make it compatible with a strict CSP implementation?Beta Was this translation helpful? Give feedback.
All reactions