diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-11-11 20:59:17 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-11-11 20:59:17 +0000 |
commit | 05690057590a2a8d7fe82a1d5df4412ddf879829 (patch) | |
tree | e0aaa63d4852b1f3ccb0623a2d83d33078c018a2 /app | |
parent | 81d69525879b0e39b91b46dd2a3bd46db5c3609d (diff) | |
download | redmine-05690057590a2a8d7fe82a1d5df4412ddf879829.tar.gz redmine-05690057590a2a8d7fe82a1d5df4412ddf879829.zip |
Code cleanup: unverified request no longer raises a InvalidAuthenticityToken exception.
git-svn-id: http://svn.redmine.org/redmine/trunk@12267 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/application_controller.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6e53ffe01..fa97b179c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -36,11 +36,14 @@ class ApplicationController < ActionController::Base def handle_unverified_request super cookies.delete(autologin_cookie_name) + if api_request? + logger.error "API calls must include a proper Content-type header (application/xml or application/json)." + end + render_error :status => 422, :message => "Invalid form authenticity token." end before_filter :session_expiration, :user_setup, :check_if_login_required, :check_password_change, :set_localization - rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token rescue_from ::Unauthorized, :with => :deny_access rescue_from ::ActionView::MissingTemplate, :with => :missing_template @@ -450,13 +453,6 @@ class ApplicationController < ActionController::Base request.xhr? ? false : 'base' end - def invalid_authenticity_token - if api_request? - logger.error "Form authenticity token is missing or is invalid. API calls must include a proper Content-type header (text/xml or text/json)." - end - render_error "Invalid form authenticity token." - end - def render_feed(items, options={}) @items = items || [] @items.sort! {|x,y| y.event_datetime <=> x.event_datetime } |