Skip to content

Commit 54de327

Browse files
KyFaStfletchto99
authored andcommitted
alphabetize and rubocop lint
1 parent a42d5fb commit 54de327

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

lib/secure_headers/headers/policy_management.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ def self.included(base)
131131
NAVIGATE_TO => :source_list,
132132
OBJECT_SRC => :source_list,
133133
PLUGIN_TYPES => :media_type_list,
134+
PREFETCH_SRC => :source_list,
135+
REPORT_TO => :report_to_endpoint,
136+
REPORT_URI => :source_list,
134137
REQUIRE_SRI_FOR => :require_sri_for_list,
135138
REQUIRE_TRUSTED_TYPES_FOR => :require_trusted_types_for_list,
136-
REPORT_URI => :source_list,
137-
REPORT_TO => :report_to_endpoint,
138-
PREFETCH_SRC => :source_list,
139139
SANDBOX => :sandbox_list,
140140
SCRIPT_SRC => :source_list,
141141
SCRIPT_SRC_ELEM => :source_list,
@@ -161,8 +161,8 @@ def self.included(base)
161161
FORM_ACTION,
162162
FRAME_ANCESTORS,
163163
NAVIGATE_TO,
164-
REPORT_URI,
165164
REPORT_TO,
165+
REPORT_URI,
166166
]
167167

168168
FETCH_SOURCES = ALL_DIRECTIVES - NON_FETCH_SOURCES - NON_SOURCE_LIST_SOURCES

spec/lib/secure_headers/headers/content_security_policy_spec.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,30 +220,29 @@ module SecureHeaders
220220
end
221221

222222
it "supports report-to directive with endpoint name" do
223-
csp = ContentSecurityPolicy.new({default_src: %w('self'), report_to: "csp-endpoint"})
223+
csp = ContentSecurityPolicy.new({ default_src: %w('self'), report_to: "csp-endpoint" })
224224
expect(csp.value).to eq("default-src 'self'; report-to csp-endpoint")
225225
end
226226

227227
it "includes report-to before report-uri in alphabetical order" do
228-
csp = ContentSecurityPolicy.new({default_src: %w('self'), report_uri: %w(/csp_report), report_to: "csp-endpoint"})
228+
csp = ContentSecurityPolicy.new({ default_src: %w('self'), report_uri: %w(/csp_report), report_to: "csp-endpoint" })
229229
expect(csp.value).to eq("default-src 'self'; report-to csp-endpoint; report-uri /csp_report")
230230
end
231231

232232
it "does not add report-to if the endpoint name is empty" do
233-
csp = ContentSecurityPolicy.new({default_src: %w('self'), report_to: ""})
233+
csp = ContentSecurityPolicy.new({ default_src: %w('self'), report_to: "" })
234234
expect(csp.value).to eq("default-src 'self'")
235235
end
236236

237237
it "does not add report-to if not provided" do
238-
csp = ContentSecurityPolicy.new({default_src: %w('self')})
238+
csp = ContentSecurityPolicy.new({ default_src: %w('self') })
239239
expect(csp.value).not_to include("report-to")
240240
end
241241

242242
it "supports report-to without report-uri" do
243-
csp = ContentSecurityPolicy.new({default_src: %w('self'), report_to: "reporting-endpoint-name"})
243+
csp = ContentSecurityPolicy.new({ default_src: %w('self'), report_to: "reporting-endpoint-name" })
244244
expect(csp.value).to eq("default-src 'self'; report-to reporting-endpoint-name")
245245
end
246246
end
247247
end
248248
end
249-

spec/lib/secure_headers_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,4 +670,3 @@ module SecureHeaders
670670
end
671671
end
672672
end
673-

0 commit comments

Comments
 (0)