Problem/Motivation

For compatibility with persistent app servers, CSP 2.3 no longer stores the nonce value for a request in a static variable which would persist across requests and instead stores it in an attribute on the main request. If the value is attempted to be used before the request is available, an exception is thrown since it is unable to be stored.

Because kint.module attempts to use the value when the file is loaded, before the request is initialized, all requests to the site - both through a browser and drush - fail with an exception.

Steps to reproduce

Enable CSP module ^2.3.0 and Kint module on a site.

Proposed resolution

Move initializing the nonce value for Kint to use to a KernelEvents::REQUEST subscriber.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork kint-3641390

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gapple created an issue. See original summary.

gapple’s picture

Status: Active » Needs review

  • jnvsor committed ad5af0cf on 2.x authored by gapple
    fix: #3641390 Retrieving nonce in .module causes fatal exception with...
jnvsor’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

jnvsor’s picture

Status: Fixed » Closed (fixed)

Released in 2.3.6