mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
Avoid return not_found...
in api/web/embeds
This commit is contained in:
parent
4fa203e69e
commit
2d95c85c8b
|
@ -4,10 +4,9 @@ class Api::Web::EmbedsController < Api::Web::BaseController
|
||||||
include Authorization
|
include Authorization
|
||||||
|
|
||||||
before_action :set_status
|
before_action :set_status
|
||||||
|
before_action :verify_embed_allowed
|
||||||
|
|
||||||
def show
|
def show
|
||||||
return not_found if @status.hidden?
|
|
||||||
|
|
||||||
if @status.local?
|
if @status.local?
|
||||||
render json: @status, serializer: OEmbedSerializer
|
render json: @status, serializer: OEmbedSerializer
|
||||||
else
|
else
|
||||||
|
@ -27,6 +26,12 @@ class Api::Web::EmbedsController < Api::Web::BaseController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def verify_embed_allowed
|
||||||
|
not_found if @status.hidden?
|
||||||
|
end
|
||||||
|
|
||||||
def set_status
|
def set_status
|
||||||
@status = Status.find(params[:id])
|
@status = Status.find(params[:id])
|
||||||
authorize @status, :show?
|
authorize @status, :show?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user