From 5da04db9cda3342d4bbedb6111e8c54901084730 Mon Sep 17 00:00:00 2001 From: evazion Date: Sat, 23 May 2020 22:01:29 -0500 Subject: [PATCH] api: rename `error` url param to `cause_error`. Rename the `error` url param to `cause_error`. Using this param causes Danbooru to return an error response for testing purposes. Calling this param `error` caused problems when OAuth2 authorization failed and the user was redirected back to Danbooru with the `error` param set. --- app/controllers/application_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 934a82fec..a0825ee0d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -152,9 +152,9 @@ class ApplicationController < ActionController::Base # allow api clients to force errors for testing purposes. def cause_error - return unless params[:error].present? + return unless params[:cause_error].present? - status = params[:error].to_i + status = params[:cause_error].to_i raise ArgumentError, "invalid status code" unless status.in?(400..599) error = StandardError.new(params[:message])