Optionally load the hsts with preload

This commit is contained in:
Ronald Claveau 2022-12-11 18:43:03 +01:00
parent 736b4283b0
commit dcc67e86a6

View File

@ -46,6 +46,7 @@ Rails.application.configure do
config.force_ssl = true
config.ssl_options = {
hsts: { preload: ENV['HSTS_PRELOAD'] == 'true' },
redirect: {
exclude: -> request { request.path.start_with?('/health') || request.headers["Host"].end_with?('.onion') || request.headers["Host"].end_with?('.i2p') }
}