mirror of
https://github.com/discourse/discourse.git
synced 2025-04-10 15:40:52 +08:00
FEATURE: Enable inline onebox for all domains by default (#11523)
This commit is contained in:
parent
6380a0a250
commit
2d667a3bd0
@ -1605,7 +1605,7 @@ onebox:
|
|||||||
type: list
|
type: list
|
||||||
list_type: compact
|
list_type: compact
|
||||||
enable_inline_onebox_on_all_domains:
|
enable_inline_onebox_on_all_domains:
|
||||||
default: false
|
default: true
|
||||||
force_custom_user_agent_hosts:
|
force_custom_user_agent_hosts:
|
||||||
default: "http://codepen.io"
|
default: "http://codepen.io"
|
||||||
type: list
|
type: list
|
||||||
|
@ -42,6 +42,9 @@ class InlineOneboxer
|
|||||||
opts[:post_author] = post_author_for_title(topic, post_number)
|
opts[:post_author] = post_author_for_title(topic, post_number)
|
||||||
end
|
end
|
||||||
return onebox_for(url, topic.title, opts)
|
return onebox_for(url, topic.title, opts)
|
||||||
|
else
|
||||||
|
# not permitted to see topic
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -148,6 +148,7 @@ describe InlineOneboxer do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "will not crawl domains that aren't allowlisted" do
|
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)
|
onebox = InlineOneboxer.lookup("https://eviltrout.com", skip_cache: true)
|
||||||
expect(onebox).to be_blank
|
expect(onebox).to be_blank
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user