Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to avoid leaking exception messages in the response body #98

Open
davidor opened this issue Jan 27, 2020 · 1 comment
Open

Option to avoid leaking exception messages in the response body #98

davidor opened this issue Jan 27, 2020 · 1 comment

Comments

@davidor
Copy link

davidor commented Jan 27, 2020

When the application raises an exception, Falcon returns the message of the exception in the response body. I think it would be great to introduce a flag to disable this. In development environments seeing the exception message can be helpful. However, in a production environment, we might want to show a generic error message instead.

Puma has an option to do this: https://github.com/puma/puma/blob/6baa4d8e1c88f2e4db2918df48416a5c49feec40/lib/puma/server.rb#L919

Is there a way to do this in Falcon? I have not found anything in the docs. If there isn't a way to do this, @ioquatix would you be open to introduce this feature? I'm happy to help.

@ioquatix
Copy link
Member

It's a good idea.

It probably fits in with falcon host, which is intended for production, more than falcon serve which is intended for development. You'd need to check the master branch and look at Falcon::Service::Application and consider adding a new option to the host configuration, or simply disabling it by default which might make more sense for production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants