Skip to content

Commit 9357c7c

Browse files
authored
Merge pull request #367 from ptoomey3/master
Update Expect-CT to use separator in spec
2 parents cc3d97b + 0190de9 commit 9357c7c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 5.0.1
2+
3+
- Updates `Expect-CT` header to use a comma separator between directives, as specified in the most current spec.
4+
15
## 5.0.0
26

37
Well this is a little embarassing. 4.0 was supposed to set the secure/httponly/samesite=lax attributes on cookies by default but it didn't. Now it does. - See the [upgrading to 5.0](docs/upgrading-to-5-0.md) guide.

lib/secure_headers/headers/expect_certificate_transparency.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def value
4949
enforced_directive,
5050
max_age_directive,
5151
report_uri_directive
52-
].compact.join("; ").strip
52+
].compact.join(", ").strip
5353
end
5454

5555
def enforced_directive

spec/lib/secure_headers/headers/expect_certificate_spec.rb renamed to spec/lib/secure_headers/headers/expect_certificate_transparency_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
module SecureHeaders
55
describe ExpectCertificateTransparency do
6-
specify { expect(ExpectCertificateTransparency.new(max_age: 1234, enforce: true).value).to eq("enforce; max-age=1234") }
6+
specify { expect(ExpectCertificateTransparency.new(max_age: 1234, enforce: true).value).to eq("enforce, max-age=1234") }
77
specify { expect(ExpectCertificateTransparency.new(max_age: 1234, enforce: false).value).to eq("max-age=1234") }
88
specify { expect(ExpectCertificateTransparency.new(max_age: 1234, enforce: "yolocopter").value).to eq("max-age=1234") }
9-
specify { expect(ExpectCertificateTransparency.new(max_age: 1234, report_uri: "https://report-uri.io/expect-ct").value).to eq("max-age=1234; report-uri=\"https://report-uri.io/expect-ct\"") }
9+
specify { expect(ExpectCertificateTransparency.new(max_age: 1234, report_uri: "https://report-uri.io/expect-ct").value).to eq("max-age=1234, report-uri=\"https://report-uri.io/expect-ct\"") }
1010
specify do
1111
config = { enforce: true, max_age: 1234, report_uri: "https://report-uri.io/expect-ct" }
12-
header_value = "enforce; max-age=1234; report-uri=\"https://report-uri.io/expect-ct\""
12+
header_value = "enforce, max-age=1234, report-uri=\"https://report-uri.io/expect-ct\""
1313
expect(ExpectCertificateTransparency.new(config).value).to eq(header_value)
1414
end
1515

0 commit comments

Comments
 (0)