Sha256: 93a7e37bb236ab9fbf583ea93379cfe34f96c3f64f3eeb1417058236319b580a

Contents?: true

Size: 614 Bytes

Versions: 3

Compression:

Stored size: 614 Bytes

Contents

require 'rails'

module EnforceSsl
  class BaseRailtie

    def self.configuration(app)
      app.config.class.class_eval do
        attr_accessor :no_ssl_port
        attr_accessor :ssl_port
        attr_accessor :hsts_max_age
        attr_accessor :hsts_include_sub_domain
      end
      if Rails.env == "production"
        app.config.no_ssl_port = 80
        app.config.ssl_port = 443
      else
        app.config.no_ssl_port = 8080
        app.config.ssl_port = 8443
      end
      app.config.hsts_include_sub_domain = false
      app.config.hsts_max_age = 31536000 # one year in seconds
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
enforce-ssl-0.2.2 lib/enforce_ssl/base_railtie.rb
enforce-ssl-0.2.1 lib/enforce_ssl/base_railtie.rb
enforce-ssl-0.2.0 lib/enforce_ssl/base_railtie.rb