1
0
Fork 0
discourse-custom-wizard-unl.../lib/custom_wizard/extensions/content_security_policy_extension.rb

13 Zeilen
417 B
Ruby

2022-04-11 12:21:38 +02:00
# frozen_string_literal: true
module CustomWizardContentSecurityPolicyExtension
def path_specific_extension(path_info)
super.tap do |obj|
for_wizard_qunit_route = !Rails.env.production? && ["/w/qunit"].include?(path_info)
puts "PATH INFO: #{path_info}"
puts "FOR WIZARD QUNIT ROUTE: #{for_wizard_qunit_route}"
obj[:script_src] = :unsafe_eval if for_wizard_qunit_route
end
end
end