From 0970b49db8de1f0953e73224a19f74195c45ea1c Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Mon, 11 Apr 2022 15:24:10 +0200 Subject: [PATCH] Remove unnecessary extensions --- .../extensions/content_security_policy_extension.rb | 12 ------------ plugin.rb | 7 ------- 2 files changed, 19 deletions(-) delete mode 100644 lib/custom_wizard/extensions/content_security_policy_extension.rb diff --git a/lib/custom_wizard/extensions/content_security_policy_extension.rb b/lib/custom_wizard/extensions/content_security_policy_extension.rb deleted file mode 100644 index fa7a166c..00000000 --- a/lib/custom_wizard/extensions/content_security_policy_extension.rb +++ /dev/null @@ -1,12 +0,0 @@ -# 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 diff --git a/plugin.rb b/plugin.rb index 3c0a840a..a397e3a7 100644 --- a/plugin.rb +++ b/plugin.rb @@ -22,8 +22,6 @@ if Rails.env.production? } end -puts "BEFORE ADD ASSET PATHS" - if Rails.env.test? config = Rails.application.config plugin_asset_path = "#{Rails.root}/plugins/discourse-custom-wizard/assets" @@ -82,8 +80,6 @@ def each_globbed_asset end end -puts "LOADING CUSTOM WIZARD PLUGIN" - after_initialize do %w[ ../lib/custom_wizard/engine.rb @@ -148,7 +144,6 @@ after_initialize do ../lib/custom_wizard/extensions/custom_field/serializer.rb ../lib/custom_wizard/extensions/custom_field/extension.rb ../lib/custom_wizard/extensions/discourse_tagging.rb - ../lib/custom_wizard/extensions/content_security_policy_extension.rb ].each do |path| load File.expand_path(path, __FILE__) end @@ -254,8 +249,6 @@ after_initialize do ::InvitesController.prepend InvitesControllerCustomWizard ::UsersController.prepend CustomWizardUsersController ::Guardian.prepend CustomWizardGuardian - puts "PREPENDING CSP EXTENSION" - ::ContentSecurityPolicy::Extension.singleton_class.prepend CustomWizardContentSecurityPolicyExtension full_path = "#{Rails.root}/plugins/discourse-custom-wizard/assets/stylesheets/wizard/wizard_custom.scss" if Stylesheet::Importer.respond_to?(:plugin_assets)