Skip to content

Commit fd18e61

Browse files
Codespaces用ドメイン設定を再定義
1 parent d6fea56 commit fd18e61

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

config/environments/development.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,15 @@
6969

7070
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
7171
# config.generators.apply_rubocop_autocorrect_after_generate!
72+
73+
pf_domain = ENV['GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN']
74+
config.action_dispatch.default_headers = {
75+
'X-Frame-Options' => "ALLOW-FROM #{pf_domain}"
76+
}
77+
78+
# Allow requests from our preview domain.
79+
pf_host = "#{ENV['CODESPACE_NAME']}-3000.#{pf_domain}"
80+
config.hosts << pf_host
81+
82+
config.action_cable.allowed_request_origins = ["https://#{pf_host}"]
7283
end

0 commit comments

Comments
 (0)