Sha256: e6fb037797540bc93f3b947db9c8cd6a9264b19431b9f00fffb25e3f9c8cc30f

Contents?: true

Size: 565 Bytes

Versions: 2

Compression:

Stored size: 565 Bytes

Contents

require_relative "../lib/tynn/hsts"

test "hsts header" do |app|
  Tynn.helpers(Tynn::HSTS)

  Tynn.define do
  end

  app = Tynn::Test.new
  app.get("/", {})

  header = app.res.headers["Strict-Transport-Security"]

  assert_equal "max-age=15552000; includeSubdomains", header
end

test "hsts header options" do |app|
  Tynn.helpers(Tynn::HSTS, expires: 1, subdomains: false, preload: true)

  Tynn.define do
  end

  app = Tynn::Test.new
  app.get("/", {})

  header = app.res.headers["Strict-Transport-Security"]

  assert_equal "max-age=1; preload", header
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tynn-1.0.0 test/hsts_test.rb
tynn-1.0.0.rc3 test/hsts_test.rb