fix: Otherfqdns

This commit is contained in:
Andras Bacsai
2022-05-31 11:35:04 +02:00
parent c63430e342
commit f71b54deb2
2 changed files with 3 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ export const post: RequestHandler = async (event) => {
let { fqdn, exposePort, otherFqdns } = await event.request.json();
if (fqdn) fqdn = fqdn.toLowerCase();
if (otherFqdns) otherFqdns = otherFqdns.map((fqdn) => fqdn.toLowerCase());
if (otherFqdns && otherFqdns.length > 0) otherFqdns = otherFqdns.map((f) => f.toLowerCase());
if (exposePort) exposePort = Number(exposePort);
try {
@@ -25,7 +25,7 @@ export const post: RequestHandler = async (event) => {
})
};
}
if (otherFqdns) {
if (otherFqdns && otherFqdns.length > 0) {
for (const ofqdn of otherFqdns) {
const domain = getDomain(ofqdn);
const nakedDomain = domain.replace('www.', '');