mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-15 08:48:15 +00:00
Compare to web_domain instead of local_domain when dealing with feeds/API
This commit is contained in:
parent
ab6d32f6b7
commit
a9a3054302
|
@ -30,7 +30,7 @@ class Api::PushController < ApiController
|
|||
params = Rails.application.routes.recognize_path(uri.path)
|
||||
domain = uri.host + (uri.port ? ":#{uri.port}" : '')
|
||||
|
||||
return unless TagManager.instance.local_domain?(domain) && params[:controller] == 'accounts' && params[:action] == 'show' && params[:format] == 'atom'
|
||||
return unless TagManager.instance.web_domain?(domain) && params[:controller] == 'accounts' && params[:action] == 'show' && params[:format] == 'atom'
|
||||
|
||||
Account.find_local(params[:username])
|
||||
end
|
||||
|
|
|
@ -56,6 +56,10 @@ class TagManager
|
|||
id.start_with?("tag:#{Rails.configuration.x.local_domain}")
|
||||
end
|
||||
|
||||
def web_domain?(domain)
|
||||
domain.nil? || domain.gsub(/[\/]/, '').casecmp(Rails.configuration.x.web_domain).zero?
|
||||
end
|
||||
|
||||
def local_domain?(domain)
|
||||
domain.nil? || domain.gsub(/[\/]/, '').casecmp(Rails.configuration.x.local_domain).zero?
|
||||
end
|
||||
|
|
|
@ -7,6 +7,7 @@ https = ENV['LOCAL_HTTPS'] == 'true'
|
|||
|
||||
Rails.application.configure do
|
||||
config.x.local_domain = host
|
||||
config.x.web_domain = web_host
|
||||
config.x.use_https = https
|
||||
config.x.use_s3 = ENV['S3_ENABLED'] == 'true'
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user