Be more specific on allowed request origins by adding OFN_URL

+ add same configuration for production
This commit is contained in:
Jean-Baptiste Bellet
2022-12-29 15:17:55 +01:00
parent 992b497b75
commit b858371735
2 changed files with 4 additions and 1 deletions

View File

@@ -48,6 +48,9 @@ Openfoodnetwork::Application.configure do
reconnect_attempts: 1
}
config.action_cable.url = "#{ENV['OFN_URL']}/cable"
config.action_cable.allowed_request_origins = [/http:\/\/#{ENV['OFN_URL']}\/*/, /https:\/\/#{ENV['OFN_URL']}\/*/]
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

View File

@@ -49,7 +49,7 @@ Openfoodnetwork::Application.configure do
}
config.action_cable.url = "#{ENV['OFN_URL']}/cable"
config.action_cable.allowed_request_origins = [/http:\/\/*/, /https:\/\/*/]
config.action_cable.allowed_request_origins = [/http:\/\/#{ENV['OFN_URL']}\/*/, /https:\/\/#{ENV['OFN_URL']}\/*/]
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"