Truncate HTTP body in error response. This is maybe useful for non-html API server.
Add this line to your application's Gemfile:
gem 'rack-truncate_error_body'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rack-truncate_error_body
in Ruby on Rails:
config.middleware.use Rack::TruncateErrorBody, only_cascaded: true, content_type: application/x-msgpack
only_cascaded
option means this middleware affects only response with "X-Cascaded: pass" header. This header is added in 404 RoutingError for example.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request