mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-27 09:13:46 +08:00
Fix Broken CSP on the shareable links page [SCI-8969] (#5911)
This commit is contained in:
parent
f856ddf78c
commit
f3bef4ae25
2 changed files with 4 additions and 2 deletions
|
@ -1,12 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%= csp_meta_tag %>
|
||||
<meta data-hook="head-js">
|
||||
<title><%=t "head.title", title: (yield :head_title) %></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %>
|
||||
<%= stylesheet_link_tag 'application', media: 'all' %>
|
||||
<%= csp_meta_tag %>
|
||||
<%= javascript_include_tag 'jquery_bundle' %>
|
||||
<%= javascript_include_tag 'application' %>
|
||||
<%= javascript_include_tag 'application_pack' %>
|
||||
|
|
|
@ -26,7 +26,9 @@ Rails.application.config.content_security_policy_nonce_generator = -> (request)
|
|||
if request.env['HTTP_TURBOLINKS_REFERRER'].present?
|
||||
request.env['HTTP_X_TURBOLINKS_NONCE']
|
||||
else
|
||||
request.session.id.to_s
|
||||
return request.session.id.to_s if request&.session&.id.present?
|
||||
|
||||
SecureRandom.base64(16)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue