mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
fix onebox for your own site
This commit is contained in:
parent
d237e3bf3b
commit
0f88947279
9 changed files with 58 additions and 12 deletions
|
@ -21,8 +21,12 @@ module Discourse
|
|||
def self.base_url
|
||||
protocol = "http"
|
||||
protocol = "https" if SiteSetting.use_ssl?
|
||||
result = "#{protocol}://#{current_hostname}"
|
||||
result << ":#{SiteSetting.port}" if SiteSetting.port.present?
|
||||
if SiteSetting.force_hostname.present?
|
||||
result = "#{protocol}://#{SiteSetting.force_hostname}"
|
||||
else
|
||||
result = "#{protocol}://#{current_hostname}"
|
||||
end
|
||||
result << ":#{SiteSetting.port}" if SiteSetting.port.present? && SiteSetting.port.to_i > 0
|
||||
result
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue