Load gravatar images over https on https pages
authorTom Hughes <tom@compton.nu>
Sat, 30 Nov 2013 15:38:11 +0000 (15:38 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 30 Nov 2013 15:38:11 +0000 (15:38 +0000)
app/helpers/user_helper.rb

index 55b1d21ab63b89839b754e4ab870b11aa5262bf1..6ef654fda8ebf1719315a46531810677b9d72043 100644 (file)
@@ -61,7 +61,7 @@ module UserHelper
     size = options[:size] || 100
     hash = Digest::MD5::hexdigest(user.email.downcase)
     default_image_url = image_url("users/images/large.png")
     size = options[:size] || 100
     hash = Digest::MD5::hexdigest(user.email.downcase)
     default_image_url = image_url("users/images/large.png")
-    url = "http://www.gravatar.com/avatar/#{hash}.jpg?s=#{size}&d=#{u(default_image_url)}"
+    url = "#{request.protocol}www.gravatar.com/avatar/#{hash}.jpg?s=#{size}&d=#{u(default_image_url)}"
   end
 
   def user_gravatar_tag(user, options = {})
   end
 
   def user_gravatar_tag(user, options = {})