Skip to content

Commit

Permalink
install robust_params_parser to get rid of 500 status code when recei…
Browse files Browse the repository at this point in the history
…ving requests that send the header content-type: application/json but no valid json in body
  • Loading branch information
patricklx committed May 13, 2015
1 parent c2f0762 commit 585bd52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ source 'https://rubygems.org' do
gem 'compass-rails'
gem 'strong_parameters'
gem 'postgres_ext'
gem 'robust_params_parser'
# ElasticSearch client
gem 'tire'
# /DROP BEFORE RAILS 4
Expand Down
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class Application < Rails::Application
config.rakismet.url = ENV['AKISMET_URL']

config.exceptions_app = self.routes

# DROP BEFORE RAILS 4
config.middleware.swap ActionDispatch::ParamsParser, ::RobustParamsParser, {}
end
end

Expand Down

0 comments on commit 585bd52

Please sign in to comment.