mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:12:45 +08:00
DEV: stub youtube embed requests (#12637)
* DEV: stub youtube embed requests * DEV: Ignore redirects on youtube.com when oneboxing
This commit is contained in:
parent
817b6c24c8
commit
50252d803e
|
@ -23,7 +23,7 @@ module Oneboxer
|
|||
end
|
||||
|
||||
def self.ignore_redirects
|
||||
@ignore_redirects ||= ['http://www.dropbox.com', 'http://store.steampowered.com', 'http://vimeo.com', Discourse.base_url]
|
||||
@ignore_redirects ||= ['http://www.dropbox.com', 'http://store.steampowered.com', 'http://vimeo.com', 'https://www.youtube.com', Discourse.base_url]
|
||||
end
|
||||
|
||||
def self.amazon_domains
|
||||
|
|
|
@ -207,6 +207,7 @@ describe Oneboxer do
|
|||
|
||||
before do
|
||||
stub_request(:any, "https://www.youtube.com/watch?v=dQw4w9WgXcQ").to_return(status: 200, body: html)
|
||||
stub_request(:any, "https://www.youtube.com/embed/dQw4w9WgXcQ").to_return(status: 403, body: nil)
|
||||
end
|
||||
|
||||
it "allows restricting engines based on the allowed_onebox_iframes setting" do
|
||||
|
|
Loading…
Reference in New Issue
Block a user