Skip to content

Commit e50ae72

Browse files
committed
Fix error to refer to 'pf_domain' variable in development
1 parent abd5419 commit e50ae72

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

config/environments/development.rb

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,20 @@
7070
# Annotate rendered view with file names.
7171
config.action_view.annotate_rendered_view_with_filenames = true
7272

73-
# Uncomment if you wish to allow Action Cable access from any origin.
74-
# config.action_cable.disable_request_forgery_protection = true
75-
pf_host = "#{ENV['CODESPACE_NAME']}-3000.#{pf_domain}"
76-
config.hosts << pf_host
77-
config.hosts << '.ngrok.io'
78-
config.action_cable.allowed_request_origins = ["https://#{pf_host}"]
79-
8073
# Raise error when a before_action's only/except options reference missing actions.
8174
config.action_controller.raise_on_missing_callback_actions = true
8275

8376
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
8477
# config.generators.apply_rubocop_autocorrect_after_generate!
8578

86-
# Enable to edit on GitHub Codespaces && allow requests from our preview domain.
79+
# Uncomment if you wish to allow Action Cable access from any origin.
80+
# config.action_cable.disable_request_forgery_protection = true
8781
pf_domain = ENV['GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN']
88-
config.action_dispatch.default_headers = {
89-
'X-Frame-Options' => "ALLOW-FROM #{pf_domain}"
90-
}
82+
pf_host = "#{ENV['CODESPACE_NAME']}-3000.#{pf_domain}"
83+
config.hosts << pf_host
84+
config.hosts << '.ngrok.io'
85+
config.action_cable.allowed_request_origins = ["https://#{pf_host}"]
86+
87+
# Enable to edit on GitHub Codespaces && allow requests from our preview domain.
88+
config.action_dispatch.default_headers = { 'X-Frame-Options' => "ALLOW-FROM #{pf_domain}" }
9189
end

0 commit comments

Comments
 (0)