]> cat aescling's git repositories - mastodon.git/commitdiff
Use null as default oEmbed height (#2842)
authorrch850 <rich850@gmail.com>
Sat, 6 May 2017 14:31:43 +0000 (23:31 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 6 May 2017 14:31:43 +0000 (16:31 +0200)
Height 640 is too big for most toots.
Twitter use null value to support flexible height.

app/controllers/api/oembed_controller.rb

index 58d8207f60833f5cebc8f4df659fc8943738871c..656851f43b9cafc652db62e59765725b18bb6ef6 100644 (file)
@@ -6,7 +6,7 @@ class Api::OEmbedController < ApiController
   def show
     @stream_entry = stream_entry_from_url(params[:url])
     @width        = params[:maxwidth].present?  ? params[:maxwidth].to_i  : 400
-    @height       = params[:maxheight].present? ? params[:maxheight].to_i : 600
+    @height       = params[:maxheight].present? ? params[:maxheight].to_i : nil
   end
 
   private