mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-16 17:28: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)
|
params = Rails.application.routes.recognize_path(uri.path)
|
||||||
domain = uri.host + (uri.port ? ":#{uri.port}" : '')
|
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])
|
Account.find_local(params[:username])
|
||||||
end
|
end
|
||||||
|
|
|
@ -56,6 +56,10 @@ class TagManager
|
||||||
id.start_with?("tag:#{Rails.configuration.x.local_domain}")
|
id.start_with?("tag:#{Rails.configuration.x.local_domain}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def web_domain?(domain)
|
||||||
|
domain.nil? || domain.gsub(/[\/]/, '').casecmp(Rails.configuration.x.web_domain).zero?
|
||||||
|
end
|
||||||
|
|
||||||
def local_domain?(domain)
|
def local_domain?(domain)
|
||||||
domain.nil? || domain.gsub(/[\/]/, '').casecmp(Rails.configuration.x.local_domain).zero?
|
domain.nil? || domain.gsub(/[\/]/, '').casecmp(Rails.configuration.x.local_domain).zero?
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,6 +7,7 @@ https = ENV['LOCAL_HTTPS'] == 'true'
|
||||||
|
|
||||||
Rails.application.configure do
|
Rails.application.configure do
|
||||||
config.x.local_domain = host
|
config.x.local_domain = host
|
||||||
|
config.x.web_domain = web_host
|
||||||
config.x.use_https = https
|
config.x.use_https = https
|
||||||
config.x.use_s3 = ENV['S3_ENABLED'] == 'true'
|
config.x.use_s3 = ENV['S3_ENABLED'] == 'true'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user