From 450ad431801b5f2c716041920842a9851b9d133c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 27 Jan 2017 16:55:06 +0100 Subject: Do not run FetchLinkCardService on local URLs, increase file size limit to 8MB, fix ProcessFeedService pushing status into distribution if called a second time while the first is still running (i.e. when a PuSH comes after a Salmon slap), fix not running escape on spoiler text before emojify --- app/lib/tag_manager.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/lib') diff --git a/app/lib/tag_manager.rb b/app/lib/tag_manager.rb index 4af433200..2508eea97 100644 --- a/app/lib/tag_manager.rb +++ b/app/lib/tag_manager.rb @@ -56,6 +56,12 @@ class TagManager domain.nil? || domain.gsub(/[\/]/, '').casecmp(Rails.configuration.x.local_domain).zero? end + def local_url?(url) + uri = Addressable::URI.parse(url) + domain = uri.host + (uri.port ? ":#{uri.port}" : '') + TagManager.instance.local_domain?(domain) + end + def uri_for(target) return target.uri if target.respond_to?(:local?) && !target.local? -- cgit