From 7e738651474582417f967ae690bb868fe90f6a1f Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Wed, 26 Oct 2011 15:11:31 -0700 Subject: [PATCH] mangle oembed stuff to prevent content warnings, only support services that work when you mangle them; please let us know if your favorite service works when you gsub out all of the https links --- app/helpers/o_embed_helper.rb | 2 +- config/initializers/oembed.rb | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/helpers/o_embed_helper.rb b/app/helpers/o_embed_helper.rb index 70d489e62..3170fbe25 100644 --- a/app/helpers/o_embed_helper.rb +++ b/app/helpers/o_embed_helper.rb @@ -20,7 +20,7 @@ module OEmbedHelper else end - return html.html_safe + return html.gsub('http', 'https').html_safe end def link_to_oembed_image(cache, prefix = 'thumbnail_') diff --git a/config/initializers/oembed.rb b/config/initializers/oembed.rb index 8947649c8..9fe992eea 100644 --- a/config/initializers/oembed.rb +++ b/config/initializers/oembed.rb @@ -9,11 +9,7 @@ OEmbed::Providers.register_fallback(OEmbed::ProviderDiscovery) # note that 'trusted_endpoint_url' is the only information # in OEmbed that we can trust. anything else may be spoofed! SECURE_ENDPOINTS = [::OEmbed::Providers::Youtube.endpoint, - ::OEmbed::Providers::Viddler.endpoint, - ::OEmbed::Providers::Qik.endpoint, - ::OEmbed::Providers::Revision3.endpoint, - ::OEmbed::Providers::Hulu.endpoint, - ::OEmbed::Providers::Vimeo.endpoint, + ::OEmbed::Providers::Flickr.endpoint, 'http://soundcloud.com/oembed', 'http://cubbi.es/oembed' ]