Skip to content

With image preview, Content-Security-Policy requires unsafe-hashes policy #114

@andrewjmaguire

Description

@andrewjmaguire

When using a Content-Security-Policy header and MultiFile image preview option, it is necessary to add the following to the policy:

style-src-attr 'unsafe-hashes' 'sha256-4qkS2iZFPnww6DrxUWQysY+9VixGcprm/tNZ4Gxr/LQ='

It may be worth providing different options to style the preview images.
E.g. having an option to add additional classes to the class attribute and not adding the style attribute in the line:

'<img class="MultiFile-preview" style="'+ MultiFile.previewCss+'"/>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions