Skip to content

Commit 961ba33

Browse files
authored
Merge pull request #2308 from openstax/csp-dev
add additional urls to allowed CSP in dev mode
2 parents 34ad4e7 + 0c5b3a7 commit 961ba33

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

config/initializers/content_security_policy.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@
1414

1515
# # Specify URI for violation reports
1616
# # policy.report_uri "/csp-violation-report-endpoint"
17-
18-
policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
17+
if Rails.env.development?
18+
policy.connect_src :self, :https,
19+
"http://localhost:2999/api/user",
20+
"http://localhost:8000",
21+
"http://localhost:3035",
22+
"ws://localhost:3035",
23+
"ws://localhost:8000"
24+
end
1925
end
2026

2127
# If you are using UJS then enable automatic nonce generation

0 commit comments

Comments
 (0)