Skip to content

Missing CSP Nonce Registration for Inline Script #178

@homecoded

Description

@homecoded

The file view/frontend/templates/hyva/add-webp-class-to-body.phtml
defines an inline-script but does not have any CSP-nonce registration.

This template is included on all pages via view/frontend/layout/hyva_default.xml, which also affects the Hyvä Checkout pages. On those pages, strict Content Security Policy rules block all unregistered inline-scripts:

Refused to execute inline script because it violates the following Content Security Policy directive

Suggested Fix:

Please add the missing call to registerInlineScript() in view/frontend/templates/hyva/add-webp-class-to-body.phtml.

Like so:
<?php $hyvaCsp->registerInlineScript(); ?>

If you're short on time, I’d be happy to submit a PR for this. Just let me know how you'd prefer to proceed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions