Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Let Rails ActionDispatch::SSL middleware handle HSTS

Christophe Bliardd6a7536a8661
diff --git a/config/initializers/secure_headers.rb b/config/initializers/secure_headers.rb
index db76a54ac72..519eb722f8a 100644
--- a/config/initializers/secure_headers.rb
+++ b/config/initializers/secure_headers.rb
@@ -5,8 +5,10 @@ Rails.application.config.after_initialize do
secure: true,
httponly: true
}
- # Add "; preload" and submit the site to hstspreload.org for best protection.
- config.hsts = "max-age=#{20.years.to_i}; includeSubdomains"
+
+ # Let Rails ActionDispatch::SSL middleware handle the Strict-Transport-Security header
+ config.hsts = SecureHeaders::OPT_OUT
+
config.x_frame_options = "SAMEORIGIN"
config.x_content_type_options = "nosniff"
config.x_xss_protection = "1; mode=block"