diff options
author | pluralcafe-docker <git@plural.cafe> | 2018-12-27 21:35:47 +0000 |
---|---|---|
committer | pluralcafe-docker <git@plural.cafe> | 2018-12-27 21:35:47 +0000 |
commit | 797a8429a0deb511e6d6092edad39f856231534e (patch) | |
tree | 6e44d3c2a5a662dfc4e4087fdc391b8e7bb41dba /app/controllers/api | |
parent | 94894b8a6ad1247306497dc8c0c47d52a8a2f72c (diff) | |
parent | f349fe2159fb36e598263f2797f041417ef7c2da (diff) |
Merge branch 'glitch'
Diffstat (limited to 'app/controllers/api')
-rw-r--r-- | app/controllers/api/v1/accounts/statuses_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/api/web/embeds_controller.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/api/v1/accounts/statuses_controller.rb b/app/controllers/api/v1/accounts/statuses_controller.rb index b68a8805f..d3f1197f8 100644 --- a/app/controllers/api/v1/accounts/statuses_controller.rb +++ b/app/controllers/api/v1/accounts/statuses_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Api::V1::Accounts::StatusesController < Api::BaseController - before_action -> { doorkeeper_authorize! :read, :'read:statuses' } + before_action -> { authorize_if_got_token! :read, :'read:statuses' } before_action :set_account after_action :insert_pagination_headers diff --git a/app/controllers/api/web/embeds_controller.rb b/app/controllers/api/web/embeds_controller.rb index 987290a14..6231733b7 100644 --- a/app/controllers/api/web/embeds_controller.rb +++ b/app/controllers/api/web/embeds_controller.rb @@ -10,6 +10,7 @@ class Api::Web::EmbedsController < Api::Web::BaseController render json: status, serializer: OEmbedSerializer, width: 400 rescue ActiveRecord::RecordNotFound oembed = FetchOEmbedService.new.call(params[:url]) + oembed[:html] = Formatter.instance.sanitize(oembed[:html], Sanitize::Config::MASTODON_OEMBED) if oembed[:html].present? if oembed render json: oembed |