FEATURE: Enable inline onebox for all domains by default ()

This commit is contained in:
Osama Sayegh 2020-12-18 02:27:32 +03:00 committed by GitHub
parent 6380a0a250
commit 2d667a3bd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

@ -1605,7 +1605,7 @@ onebox:
type: list
list_type: compact
enable_inline_onebox_on_all_domains:
default: false
default: true
force_custom_user_agent_hosts:
default: "http://codepen.io"
type: list

@ -42,6 +42,9 @@ class InlineOneboxer
opts[:post_author] = post_author_for_title(topic, post_number)
end
return onebox_for(url, topic.title, opts)
else
# not permitted to see topic
return nil
end
end
end

@ -148,6 +148,7 @@ describe InlineOneboxer do
end
it "will not crawl domains that aren't allowlisted" do
SiteSetting.enable_inline_onebox_on_all_domains = false
onebox = InlineOneboxer.lookup("https://eviltrout.com", skip_cache: true)
expect(onebox).to be_blank
end