mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Require https for embedding sites
This commit is contained in:
committed by
Maikel Linke
parent
782a812596
commit
0eb4c7f7ba
@@ -52,6 +52,7 @@ class ApplicationController < ActionController::Base
|
||||
def enable_embedded_shopfront
|
||||
whitelist = Spree::Config[:embedded_shopfronts_whitelist]
|
||||
return unless Spree::Config[:enable_embedded_shopfronts] and whitelist.present?
|
||||
return if (request.referer and URI(request.referer).scheme != 'https' and !Rails.env.test?)
|
||||
|
||||
response.headers.delete 'X-Frame-Options'
|
||||
response.headers['Content-Security-Policy'] = "frame-ancestors #{whitelist}"
|
||||
|
||||
Reference in New Issue
Block a user