mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Enable HTTP Strict-Transport-Security
This commit is contained in:
parent
17cddbccaf
commit
817dac1c48
2 changed files with 6 additions and 1 deletions
|
@ -12,7 +12,7 @@ class App < Sinatra::Application
|
|||
Rack::Mime::MIME_TYPES['.webapp'] = 'application/x-web-app-manifest+json'
|
||||
|
||||
configure do
|
||||
use Rack::SslEnforcer, only_environments: ['production', 'test'], hsts: false, force_secure_cookies: false
|
||||
use Rack::SslEnforcer, only_environments: ['production', 'test'], hsts: true, force_secure_cookies: false
|
||||
|
||||
set :sentry_dsn, ENV['SENTRY_DSN']
|
||||
set :protection, except: [:frame_options, :xss_header]
|
||||
|
|
|
@ -21,6 +21,11 @@ class AppTest < MiniTest::Spec
|
|||
assert_equal 'https://example.com/test?q=1', last_response['Location']
|
||||
end
|
||||
|
||||
it 'returns HSTS header' do
|
||||
get 'https://example.com/test'
|
||||
assert_equal 'max-age=31536000; includeSubDomains', last_response['Strict-Transport-Security']
|
||||
end
|
||||
|
||||
describe "/" do
|
||||
it "works" do
|
||||
get '/'
|
||||
|
|
Loading…
Reference in a new issue