discourse/config/initializers/100-onebox_options.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
523 B
Ruby
Raw Normal View History

# frozen_string_literal: true
Rails.application.config.to_prepare do
if Rails.env.development? && SiteSetting.port.to_i > 0
Onebox.options = {
twitter_client: TwitterApi,
redirect_limit: 3,
user_agent: "Discourse Forum Onebox v#{Discourse::VERSION::STRING}",
allowed_ports: [80, 443, SiteSetting.port.to_i]
}
else
Onebox.options = {
twitter_client: TwitterApi,
redirect_limit: 3,
user_agent: "Discourse Forum Onebox v#{Discourse::VERSION::STRING}"
}
end
end