You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a tld_size=1, requesting a url with the host 'localhost' will crash rails url_helpers. This is probably an edge case but was unavoidable for me as Monit (old version) would only use 'localhost' as a host so this made monit monitoring impossible.
The offending code
def self.host_without_subdomain(host)
parts = host.split('.')
parts[-(SubdomainFu.tld_size+1)..-1].join(".")
end
could be replaced with
def self.host_without_subdomain(host)
parts = host.split('.')
host_without_sub = parts[-(SubdomainFu.tld_size+1)..-1]
host_without_sub.blank? ? host : host_without_sub.join(".")
end
The text was updated successfully, but these errors were encountered:
With a tld_size=1, requesting a url with the host 'localhost' will crash rails url_helpers. This is probably an edge case but was unavoidable for me as Monit (old version) would only use 'localhost' as a host so this made monit monitoring impossible.
The offending code
def self.host_without_subdomain(host)
parts = host.split('.')
parts[-(SubdomainFu.tld_size+1)..-1].join(".")
end
could be replaced with
def self.host_without_subdomain(host)
parts = host.split('.')
host_without_sub = parts[-(SubdomainFu.tld_size+1)..-1]
host_without_sub.blank? ? host : host_without_sub.join(".")
end
The text was updated successfully, but these errors were encountered: