Sha256: 46a48d59415247d71bddea2ea7ae45402146d2980281519e4c4973fb597f5abc

Contents?: true

Size: 745 Bytes

Versions: 8

Compression:

Stored size: 745 Bytes

Contents

puts "Adding secure headers... ".magenta
content = <<EOF

  ensure_security_headers # See more: https://github.com/twitter/secureheaders
EOF
in_root do
  inject_into_file 'app/controllers/application_controller.rb', content, {after: "with: :exception", verbose: false}
end
create_file "config/initializers/secure_headers.rb" do
<<-EOF
::SecureHeaders::Configuration.configure do |config|
  config.hsts = {:max_age => 20.years.to_i, :include_subdomains => true}
  config.x_frame_options = 'DENY'
  config.x_content_type_options = "nosniff"
  config.x_xss_protection = {:value => 1, :mode => 'block'}
  config.csp = false
end
EOF
end
git :add => 'app/controllers/application_controller.rb'
git :commit => "-qm 'Adding secure headers.'"

puts "\n"

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pah-0.0.12 lib/pah/partials/_secure_headers.rb
pah-0.0.11 lib/pah/partials/_secure_headers.rb
pah-0.0.10 lib/pah/partials/_secure_headers.rb
pah-0.0.9 lib/pah/partials/_secure_headers.rb
pah-0.0.8 lib/pah/partials/_secure_headers.rb
pah-0.0.7 lib/pah/partials/_secure_headers.rb
pah-0.0.6 lib/pah/partials/_secure_headers.rb
pah-0.0.5 lib/pah/partials/_secure_headers.rb