mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FIX: Ignore OneBox blacklisted domains.
This commit is contained in:
@ -107,4 +107,13 @@ describe Oneboxer do
|
||||
end
|
||||
end
|
||||
|
||||
it "does not crawl blacklisted URLs" do
|
||||
SiteSetting.onebox_domains_blacklist = "git.*.com|bitbucket.com"
|
||||
url = 'https://github.com/discourse/discourse/commit/21b562852885f883be43032e03c709241e8e6d4f'
|
||||
stub_request(:head, 'https://discourse.org/').to_return(status: 302, body: "", headers: { location: url })
|
||||
|
||||
expect(Oneboxer.external_onebox(url)[:onebox]).to be_empty
|
||||
expect(Oneboxer.external_onebox('https://discourse.org/')[:onebox]).to be_empty
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user