From 38a253fcd244f8158189295cffd6490317eed0bc Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 30 Jun 2024 12:03:37 -0700 Subject: [PATCH] Improved style nonce logic --- app/views/layouts/field_test/application.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/field_test/application.html.erb b/app/views/layouts/field_test/application.html.erb index 0b5cb8e..ee7b1db 100644 --- a/app/views/layouts/field_test/application.html.erb +++ b/app/views/layouts/field_test/application.html.erb @@ -5,7 +5,7 @@ - <%= content_tag :style, nonce: content_security_policy_nonce do %> + <%= content_tag :style, nonce: request.content_security_policy_nonce_directives.include?("style-src") ? content_security_policy_nonce : nil do %> body { margin: 0; padding: 20px;