mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Display json response when Discourse::InvalidAccess
is raised for
non json requests.
This commit is contained in:
@ -157,7 +157,8 @@ class ApplicationController < ActionController::Base
|
||||
opts ||= {}
|
||||
show_json_errors = (request.format && request.format.json?) ||
|
||||
(request.xhr?) ||
|
||||
((params[:external_id] || '').ends_with? '.json')
|
||||
((params[:external_id] || '').ends_with? '.json') ||
|
||||
!(current_user rescue nil)
|
||||
|
||||
if show_json_errors
|
||||
# HACK: do not use render_json_error for topics#show
|
||||
|
Reference in New Issue
Block a user