From 550ff677daef92886ab7440ad262821f4c732e85 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 13 Sep 2017 14:22:16 +0200 Subject: Fix ActivityPub handling of replies with WEB_DOMAIN (#4895) (#4904) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix ActivityPub handling of replies when LOCAL_DOMAIN ≠ WEB_DOMAIN (#4895) For all intents and purposes, `local_url?` is used to check if an URL refers to the Web UI or the various API endpoints of the local instances. Those things reside on `WEB_DOMAIN` and not `LOCAL_DOMAIN`. * Change local_url? spec, as all URLs handled by Mastodon are based on WEB_DOMAIN --- spec/lib/tag_manager_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'spec') diff --git a/spec/lib/tag_manager_spec.rb b/spec/lib/tag_manager_spec.rb index 1cd6e0a6f..6c7830231 100644 --- a/spec/lib/tag_manager_spec.rb +++ b/spec/lib/tag_manager_spec.rb @@ -63,23 +63,23 @@ RSpec.describe TagManager do describe '#local_url?' do around do |example| - original_local_domain = Rails.configuration.x.local_domain + original_web_domain = Rails.configuration.x.web_domain example.run - Rails.configuration.x.local_domain = original_local_domain + Rails.configuration.x.web_domain = original_web_domain end it 'returns true if the normalized string with port is local URL' do - Rails.configuration.x.local_domain = 'domain:42' + Rails.configuration.x.web_domain = 'domain:42' expect(TagManager.instance.local_url?('https://DoMaIn:42/')).to eq true end it 'returns true if the normalized string without port is local URL' do - Rails.configuration.x.local_domain = 'domain' + Rails.configuration.x.web_domain = 'domain' expect(TagManager.instance.local_url?('https://DoMaIn/')).to eq true end it 'returns false for string with irrelevant characters' do - Rails.configuration.x.local_domain = 'domain' + Rails.configuration.x.web_domain = 'domain' expect(TagManager.instance.local_url?('https://domainn/')).to eq false end end -- cgit