diff --git a/config/initializers/oembed.rb b/config/initializers/oembed.rb
index e8334cdad..bf0fc2092 100644
--- a/config/initializers/oembed.rb
+++ b/config/initializers/oembed.rb
@@ -15,6 +15,8 @@ oembed_provider_list = [
OEmbed::Providers::Flickr
]
+OEmbed::Providers::Youtube.endpoint += "?scheme=https"
+
oembed_providers = YAML.load_file(Rails.root.join("config", "oembed_providers.yml"))
oembed_providers.each do |provider_name, provider|
diff --git a/features/step_definitions/oembed_steps.rb b/features/step_definitions/oembed_steps.rb
index 9a6bc29b8..7732146a0 100644
--- a/features/step_definitions/oembed_steps.rb
+++ b/features/step_definitions/oembed_steps.rb
@@ -41,7 +41,7 @@ Given /^I have several oEmbed data in cache$/ do
"thumbnail_width" => 480,
},
"link_url" => "http://youtube.com/watch?v=M3r2XDceM6A&format=json",
- "oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
+ "oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
},
"unsecure_video" => {
@@ -86,7 +86,7 @@ Given /^I have several oEmbed data in cache$/ do
"thumbnail_width" => 480,
},
"link_url" => "http://yourichtube.com/watch?v=M3r2XDceM6A&format=json",
- "oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
+ "oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
},
"unsecure_rich" => {
diff --git a/spec/controllers/jasmine_fixtures/aspects_spec.rb b/spec/controllers/jasmine_fixtures/aspects_spec.rb
index 30454e1b8..7cb66843b 100644
--- a/spec/controllers/jasmine_fixtures/aspects_spec.rb
+++ b/spec/controllers/jasmine_fixtures/aspects_spec.rb
@@ -79,7 +79,7 @@ describe StreamsController do
stub_request(
:get,
- "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://www.youtube.com/watch?v=UYrkQL1bX4A"
+ "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://www.youtube.com/watch?v=UYrkQL1bX4A"
).with(
:headers => {'Accept'=>'*/*'}
).to_return(
diff --git a/spec/helpers/o_embed_helper_spec.rb b/spec/helpers/o_embed_helper_spec.rb
index 36bf4ded9..3668a6783 100644
--- a/spec/helpers/o_embed_helper_spec.rb
+++ b/spec/helpers/o_embed_helper_spec.rb
@@ -29,7 +29,7 @@ describe OEmbedHelper do
"type" => "video",
"width" => 425,
"height" => 344,
- 'trusted_endpoint_url' => ::OEmbed::Providers::Youtube.endpoint,
+ "trusted_endpoint_url" => ::OEmbed::Providers::Youtube.endpoint,
"title" => "Amazing Nintendo Facts",
"html" => "",
},
"link_url" => "http://youtube.com/watch?v=M3r2XDceM6A&format=json",
- "oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
+ "oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
},
"unsecure_video" => {
@@ -69,7 +69,7 @@ describe OEmbedHelper do
"type" => "rich",
"width" => 425,
"height" => 344,
- 'trusted_endpoint_url' => ::OEmbed::Providers::Youtube.endpoint,
+ "trusted_endpoint_url" => ::OEmbed::Providers::Youtube.endpoint,
"title" => "Amazing Nintendo Facts",
"html" => "",
},
"link_url" => "http://youtube.com/watch?v=M3r2XDceM6A&format=json",
- "oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
+ "oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
},
"unsecure_rich" => {