Skip to content
Snippets Groups Projects
Unverified Commit e24b14cc authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix leak of existence of otherwise inaccessible statuses in REST API (#17684)

parent 02b8d63f
No related branches found
No related tags found
No related merge requests found
......@@ -92,8 +92,9 @@ class Api::V1::StatusesController < Api::BaseController
end
def set_thread
@thread = status_params[:in_reply_to_id].blank? ? nil : Status.find(status_params[:in_reply_to_id])
rescue ActiveRecord::RecordNotFound
@thread = Status.find(status_params[:in_reply_to_id]) if status_params[:in_reply_to_id].present?
authorize(@thread, :show?) if @thread.present?
rescue ActiveRecord::RecordNotFound, Mastodon::NotPermittedError
render json: { error: I18n.t('statuses.errors.in_reply_not_found') }, status: 404
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment