FIX: stop logging every time invalid params are sent

Previously we were logging warning for invalid encoded params, this can
cause a log flood
This commit is contained in:
Sam
2018-10-05 14:33:08 +10:00
parent da39a310c3
commit 5b630f3188
3 changed files with 36 additions and 1 deletions

View File

@ -252,7 +252,11 @@ class ApplicationController < ActionController::Base
if show_json_errors
# HACK: do not use render_json_error for topics#show
if request.params[:controller] == 'topics' && request.params[:action] == 'show'
return render status: status_code, layout: false, plain: (status_code == 404 || status_code == 410) ? build_not_found_page(status_code) : message
return render(
status: status_code,
layout: false,
plain: (status_code == 404 || status_code == 410) ? build_not_found_page(status_code) : message
)
end
render_json_error message, type: type, status: status_code