|
Lines 168-174
subtest 'nonce tests' => sub {
Link Here
|
| 168 |
|
168 |
|
| 169 |
$csp = Koha::ContentSecurityPolicy->new(); |
169 |
$csp = Koha::ContentSecurityPolicy->new(); |
| 170 |
my $nonce = $csp->nonce; |
170 |
my $nonce = $csp->nonce; |
| 171 |
like( $nonce, qr/\w{10}/, 'nonce is a random string of 10 characters' ); |
171 |
like( $nonce, qr/\w{22}/, 'nonce is a random string of 22 characters (128+ bits entropy)' ); |
| 172 |
is( $nonce, $csp->nonce, 're-calling nonce() returns the same randomly generated cached value' ); |
172 |
is( $nonce, $csp->nonce, 're-calling nonce() returns the same randomly generated cached value' ); |
| 173 |
|
173 |
|
| 174 |
$cache->set_in_cache( 'CSP-NONCE', 'cached value' ); |
174 |
$cache->set_in_cache( 'CSP-NONCE', 'cached value' ); |
| 175 |
- |
|
|