about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-12-23 02:16:35 +0100
committerEugen Rochko <eugen@zeonfederated.com>2018-12-23 02:16:35 +0100
commite25947db4a44cd50fa1daa36d5031a950327b646 (patch)
tree82e146ce7bb5297d8e1c8bc745c569f9170aa7e1 /app/controllers/api
parentbb62827c16dbf35c70da2dc801f602df3c76fcca (diff)
Sanitize and sandbox toot embeds (#9552)
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/web/embeds_controller.rb1
1 files changed, 1 insertions, 0 deletions
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