Skip to content

Commit

Permalink
Fix 422 being returned instead of 404 when POSTing (mastodon#11574)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and multiple creatures committed Feb 21, 2020
1 parent 961e57f commit 5063f47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class ApplicationController < ActionController::Base
before_action :store_current_location, except: :raise_not_found, unless: :devise_controller?
before_action :check_user_permissions, if: :user_signed_in?

skip_before_action :verify_authenticity_token, only: :raise_not_found

def raise_not_found
raise ActionController::RoutingError, "No route matches #{params[:unmatched_route]}"
end
Expand Down

0 comments on commit 5063f47

Please sign in to comment.