Skip to content

Commit e1b4b59

Browse files
committed
inline one-time use variable
1 parent 20ec917 commit e1b4b59

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

spec/lib/secure_headers_spec.rb

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22

33
module SecureHeaders
44
describe SecureHeaders do
5-
example_hpkp_config = {
6-
max_age: 1_000_000,
7-
include_subdomains: true,
8-
report_uri: '//example.com/uri-directive',
9-
pins: [
10-
{ sha256: 'abc' },
11-
{ sha256: '123' }
12-
]
13-
}
14-
15-
example_hpkp_config_value = %(max-age=1000000; pin-sha256="abc"; pin-sha256="123"; report-uri="//example.com/uri-directive"; includeSubDomains)
16-
175
before(:each) do
186
reset_config
197
end
@@ -90,7 +78,15 @@ module SecureHeaders
9078
it "does not set the HPKP header if request is over HTTP" do
9179
plaintext_request = Rack::Request.new({})
9280
Configuration.default do |config|
93-
config.hpkp = example_hpkp_config
81+
config.hpkp = {
82+
max_age: 1_000_000,
83+
include_subdomains: true,
84+
report_uri: '//example.com/uri-directive',
85+
pins: [
86+
{ sha256: 'abc' },
87+
{ sha256: '123' }
88+
]
89+
}
9490
end
9591

9692
expect(SecureHeaders.header_hash_for(plaintext_request)[PublicKeyPins::HEADER_NAME]).to be_nil

0 commit comments

Comments
 (0)