summaryrefslogtreecommitdiff
path: root/app/controllers/projects/static_site_editor_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/static_site_editor_controller.rb')
-rw-r--r--app/controllers/projects/static_site_editor_controller.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/controllers/projects/static_site_editor_controller.rb b/app/controllers/projects/static_site_editor_controller.rb
index 7e2e32a843f..5c3d9b60877 100644
--- a/app/controllers/projects/static_site_editor_controller.rb
+++ b/app/controllers/projects/static_site_editor_controller.rb
@@ -6,12 +6,16 @@ class Projects::StaticSiteEditorController < Projects::ApplicationController
layout 'fullscreen'
+ content_security_policy do |policy|
+ next if policy.directives.blank?
+
+ frame_src_values = Array.wrap(policy.directives['frame-src']) | ['https://www.youtube.com']
+ policy.frame_src(*frame_src_values)
+ end
+
prepend_before_action :authenticate_user!, only: [:show]
before_action :assign_ref_and_path, only: [:show]
before_action :authorize_edit_tree!, only: [:show]
- before_action do
- push_frontend_feature_flag(:sse_image_uploads)
- end
feature_category :static_site_editor
@@ -47,6 +51,8 @@ class Projects::StaticSiteEditorController < Projects::ApplicationController
payload.transform_values do |value|
if value.is_a?(String) || value.is_a?(Integer)
value
+ elsif value.nil?
+ ''
else
value.to_json
end