mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 18:45:41 +01:00
Merge pull request from GHSA-v3xf-c9qf-j667
This commit is contained in:
parent
ff32475f5f
commit
eeab3560fc
1 changed files with 3 additions and 3 deletions
|
@ -7,18 +7,18 @@ class TagManager
|
||||||
include RoutingHelper
|
include RoutingHelper
|
||||||
|
|
||||||
def web_domain?(domain)
|
def web_domain?(domain)
|
||||||
domain.nil? || domain.delete('/').casecmp(Rails.configuration.x.web_domain).zero?
|
domain.nil? || domain.delete_suffix('/').casecmp(Rails.configuration.x.web_domain).zero?
|
||||||
end
|
end
|
||||||
|
|
||||||
def local_domain?(domain)
|
def local_domain?(domain)
|
||||||
domain.nil? || domain.delete('/').casecmp(Rails.configuration.x.local_domain).zero?
|
domain.nil? || domain.delete_suffix('/').casecmp(Rails.configuration.x.local_domain).zero?
|
||||||
end
|
end
|
||||||
|
|
||||||
def normalize_domain(domain)
|
def normalize_domain(domain)
|
||||||
return if domain.nil?
|
return if domain.nil?
|
||||||
|
|
||||||
uri = Addressable::URI.new
|
uri = Addressable::URI.new
|
||||||
uri.host = domain.delete('/')
|
uri.host = domain.delete_suffix('/')
|
||||||
uri.normalized_host
|
uri.normalized_host
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue