5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-20 08:26:21 +00:00

fix: ignorar los subdominios en los dominios alternativos #13159

This commit is contained in:
f 2023-04-19 14:56:56 -03:00
parent 5dadf64422
commit 0dbcb85180

View file

@ -18,10 +18,16 @@ module Api
name.end_with?('.') ? name[0..-2] : "#{name}.#{Site.domain}"
end
def subdomain?(name)
name.end_with? ".#{Site.domain}"
end
# Dominios alternativos
def alternative_names
(DeployAlternativeDomain.all.map(&:hostname) + DeployLocalizedDomain.all.map(&:hostname)).map do |name|
canonicalize name
end.reject do |name|
subdomain? name
end
end
@ -34,6 +40,8 @@ module Api
.or(Site.where(colaboracion_anonima: true))
.select("'api.' || name as name").map(&:name).map do |name|
canonicalize name
end.reject do |name|
subdomain? name
end
end