fix: small fix

Signed-off-by: Manuel Roth <manuelroth@hotmail.ch>
This commit is contained in:
Manuel Roth 2023-01-31 11:00:08 +01:00 committed by Andrew Calcutt
parent 9e6b683e78
commit a718f6cc7c

View file

@ -31,10 +31,10 @@ export const getTileUrls = (req, domains, path, format, publicUrl, aliases) => {
if (domains.constructor === String && domains.length > 0) { if (domains.constructor === String && domains.length > 0) {
domains = domains.split(','); domains = domains.split(',');
} }
const hostParts = host.split('.'); const hostParts = urlObject.host.split('.');
const relativeSubdomainsUsable = const relativeSubdomainsUsable =
hostParts.length > 1 && hostParts.length > 1 &&
!/^([0-9]{1,3}\.){3}[0-9]{1,3}(\:[0-9]+)?$/.test(host); !/^([0-9]{1,3}\.){3}[0-9]{1,3}(\:[0-9]+)?$/.test(urlObject.host);
const newDomains = []; const newDomains = [];
for (const domain of domains) { for (const domain of domains) {
if (domain.indexOf('*') !== -1) { if (domain.indexOf('*') !== -1) {