lib/onebox/engine/standard_embed.rb in onebox-1.8.47 vs lib/onebox/engine/standard_embed.rb in onebox-1.8.48
- old
+ new
@@ -125,12 +125,15 @@
if favicon && !!(favicon =~ /^\/\//)
uri = URI(url)
favicon = "#{uri.scheme}:#{favicon}"
elsif favicon && favicon.match(/^https?:\/\//i).nil?
uri = URI(url)
- favicon = "#{uri.scheme}://#{uri.host.sub(/\/$/, '')}/#{favicon.sub(/^\//, '')}"
+ favicon = if !(favicon =~ /^\//) && uri.path.present?
+ "#{uri.scheme}://#{uri.host.sub(/\/$/, '')}#{uri.path.sub(/\/$/, '')}/#{favicon.sub(/^\//, '')}"
+ else
+ "#{uri.scheme}://#{uri.host.sub(/\/$/, '')}/#{favicon.sub(/^\//, '')}"
+ end
end
-
favicon
end
end
end
end