Skip to content

Commit 012286b

Browse files
committed
Default to more restrictive backtrace configuration
Needed to avoid exposing stack traces in non-production but non-development environments (e.g. "staging")
1 parent 18cb4f6 commit 012286b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/jsonapi/configuration.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ def initialize
8080
self.use_text_errors = false
8181

8282
# Whether or not to include exception backtraces in JSONAPI error
83-
# responses. Defaults to `false` in production, and `true` otherwise.
84-
self.include_backtraces_in_errors = !Rails.env.production?
83+
# responses. Defaults to `false` in anything other than development or test.
84+
self.include_backtraces_in_errors = (Rails.env.development? || Rails.env.test?)
8585

8686
# Whether or not to include exception application backtraces in JSONAPI error
87-
# responses. Defaults to `false` in production, and `true` otherwise.
88-
self.include_application_backtraces_in_errors = !Rails.env.production?
87+
# responses. Defaults to `false` in anything other than development or test.
88+
self.include_application_backtraces_in_errors = (Rails.env.development? || Rails.env.test?)
8989

9090
# List of classes that should not be rescued by the operations processor.
9191
# For example, if you use Pundit for authorization, you might

0 commit comments

Comments
 (0)