mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-19 04:53:38 +00:00
fix: ignorar los subdominios en los dominios alternativos #13159
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
9e348bfdd8
commit
11fe98ecdc
1 changed files with 8 additions and 0 deletions
|
@ -18,10 +18,16 @@ module Api
|
||||||
name.end_with?('.') ? name[0..-2] : "#{name}.#{Site.domain}"
|
name.end_with?('.') ? name[0..-2] : "#{name}.#{Site.domain}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def subdomain?(name)
|
||||||
|
name.end_with? ".#{Site.domain}"
|
||||||
|
end
|
||||||
|
|
||||||
# Dominios alternativos
|
# Dominios alternativos
|
||||||
def alternative_names
|
def alternative_names
|
||||||
(DeployAlternativeDomain.all.map(&:hostname) + DeployLocalizedDomain.all.map(&:hostname)).map do |name|
|
(DeployAlternativeDomain.all.map(&:hostname) + DeployLocalizedDomain.all.map(&:hostname)).map do |name|
|
||||||
canonicalize name
|
canonicalize name
|
||||||
|
end.reject do |name|
|
||||||
|
subdomain? name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -34,6 +40,8 @@ module Api
|
||||||
.or(Site.where(colaboracion_anonima: true))
|
.or(Site.where(colaboracion_anonima: true))
|
||||||
.select("'api.' || name as name").map(&:name).map do |name|
|
.select("'api.' || name as name").map(&:name).map do |name|
|
||||||
canonicalize name
|
canonicalize name
|
||||||
|
end.reject do |name|
|
||||||
|
subdomain? name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue