mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
FIX: include onebox default options in development environment
This commit is contained in:
parent
9c1a713c6e
commit
6a417c308f
@ -1,7 +1,16 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Onebox.options = {
|
if Rails.env.development? && SiteSetting.port.to_i > 0
|
||||||
twitter_client: TwitterApi,
|
Onebox.options = {
|
||||||
redirect_limit: 3,
|
twitter_client: TwitterApi,
|
||||||
user_agent: "Discourse Forum Onebox v#{Discourse::VERSION::STRING}"
|
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
|
||||||
|
@ -290,10 +290,6 @@ module Oneboxer
|
|||||||
|
|
||||||
options[:cookie] = fd.cookie if fd.cookie
|
options[:cookie] = fd.cookie if fd.cookie
|
||||||
|
|
||||||
if Rails.env.development? && SiteSetting.port.to_i > 0
|
|
||||||
Onebox.options = { allowed_ports: [80, 443, SiteSetting.port.to_i] }
|
|
||||||
end
|
|
||||||
|
|
||||||
r = Onebox.preview(uri.to_s, options)
|
r = Onebox.preview(uri.to_s, options)
|
||||||
|
|
||||||
{ onebox: r.to_s, preview: r&.placeholder_html.to_s }
|
{ onebox: r.to_s, preview: r&.placeholder_html.to_s }
|
||||||
|
Loading…
Reference in New Issue
Block a user