about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/tag_manager.rb6
1 files changed, 6 insertions, 0 deletions
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?