Sha256: 99524d920d5969b583050140606e8cfa3f2e74912c1efe320bbc898519491133
Contents?: true
Size: 975 Bytes
Versions: 308
Compression:
Stored size: 975 Bytes
Contents
module GovukPublishingComponents class ApplicationController < ActionController::Base helper ::Rails.application.helpers protect_from_forgery with: :exception before_action :set_x_frame_options_header before_action :set_disable_slimmer_header if defined? content_security_policy content_security_policy do |p| # don't do anything if the app doesn't have a content security policy next unless p.directives.any? # Unfortunately the axe core script uses a dependency that uses eval # see: https://github.com/dequelabs/axe-core/issues/1175 # Thus all components shown by govuk_publishing_components need this # enabled p.script_src(*p.script_src, :unsafe_eval) end end private def set_x_frame_options_header response.headers["X-Frame-Options"] = "ALLOWALL" end def set_disable_slimmer_header response.headers["X-Slimmer-Skip"] = "true" end end end
Version data entries
308 entries across 308 versions & 1 rubygems