Skip to content

Csp module enhancement #28066

Open
Open
@HirokazuNishi

Description

@HirokazuNishi

Description (*)

Csp module is bundled in Magento 2.3.5 and later, but it causes really noisy error messages when we enable browser's developer tool. This situation is caused by "no report-uri" value in CSP header.

Expected behavior (*)

Current default CSP header mode is "report only", but it should be used in developer mode. CSP header should be disabled in other modes by default. Also to add cli or admin configuration page for switching CSP header is nice.

Benefits

Current implementation is really noisy for production/deault environment. To improve CSP module, we can show CSP "report only mode" result for developers only.

Environment

  • Magento 2.3.5
  • Google Chrome 81.0.4044.129 on Mac OS 10.15.4

Steps to Reproduce

  1. Install vanilla Magento 2.3.5 with sample data.
  2. Enable developer tool on your browser.
  3. Access to any page you want.
  4. Check console and you can see CSP error message.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready for Grooming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions