File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,22 @@ module SecureHeaders
99
1010 let ( :request ) { Rack ::Request . new ( "HTTP_X_FORWARDED_SSL" => "on" ) }
1111
12+ it "has a HEADER_NAME with no capital letters" do
13+ # Iterate through all headerable attributes
14+ Configuration ::HEADERABLE_ATTRIBUTES . each do |attr |
15+ klass = Configuration ::CONFIG_ATTRIBUTES_TO_HEADER_CLASSES [ attr ]
16+ next if [ SecureHeaders ::ContentSecurityPolicy ] . include? klass
17+ expect ( klass ::HEADER_NAME ) . to eq ( klass ::HEADER_NAME . downcase )
18+ end
19+
20+ # Now to iterate through the CSP and CSP-Report-Only classes, since they're registered differently
21+ klass = SecureHeaders ::ContentSecurityPolicyConfig
22+ expect ( klass ::HEADER_NAME ) . to eq ( klass ::HEADER_NAME . downcase )
23+
24+ klass = SecureHeaders ::ContentSecurityPolicyReportOnlyConfig
25+ expect ( klass ::HEADER_NAME ) . to eq ( klass ::HEADER_NAME . downcase )
26+ end
27+
1228 it "raises a NotYetConfiguredError if default has not been set" do
1329 expect do
1430 SecureHeaders . header_hash_for ( request )
You can’t perform that action at this time.
0 commit comments