Skip to content

Commit

Permalink
apply upstream patch 9deb1781 (#500)
Browse files Browse the repository at this point in the history
Co-authored-by: Anon <[email protected]>
  • Loading branch information
weex and Anon committed Sep 20, 2023
1 parent 2795304 commit ad2d2e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/lib/tag_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ class TagManager
include RoutingHelper

def web_domain?(domain)
domain.nil? || domain.gsub(/[\/]/, '').casecmp(Rails.configuration.x.web_domain).zero?
domain.nil? || domain.delete_suffix('/').casecmp(Rails.configuration.x.web_domain).zero?
end

def local_domain?(domain)
domain.nil? || domain.gsub(/[\/]/, '').casecmp(Rails.configuration.x.local_domain).zero?
domain.nil? || domain.delete_suffix('/').casecmp(Rails.configuration.x.local_domain).zero?
end

def normalize_domain(domain)
return if domain.nil?

uri = Addressable::URI.new
uri.host = domain.gsub(/[\/]/, '')
uri.host = domain.delete_suffix('/')
uri.normalized_host
end

Expand Down

0 comments on commit ad2d2e8

Please sign in to comment.