We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cbb5e7 commit 837c945Copy full SHA for 837c945
1 file changed
spec/example_app/config/environments/development.rb
@@ -75,4 +75,11 @@
75
76
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
77
# config.generators.apply_rubocop_autocorrect_after_generate!
78
+
79
+ # In the current GitHub Codespaces, the Origin header is rewritten, which breaks CSRF protection.
80
+ # See: https://github.com/orgs/community/discussions/156532
81
+ if ENV["GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN"] == "app.github.dev"
82
+ warn "WARNING: (development) Disabling CSRF protection Origin header check!"
83
+ config.action_controller.forgery_protection_origin_check = false
84
+ end
85
end
0 commit comments