fix: exposedPorts

This commit is contained in:
Andras Bacsai
2022-05-04 15:45:44 +02:00
parent 90fde24b40
commit 2e8fd6f0c7
9 changed files with 32 additions and 41 deletions

View File

@@ -50,10 +50,13 @@ export const post: RequestHandler = async (event) => {
exposePort = Number(exposePort);
if (exposePort < 1024 || exposePort > 65535) {
throw { message: `Expose Port needs to be between 1024 and 65535` };
throw { message: `Expose Port needs to be between 1024 and 65535.` };
}
const publicPort = await getPort({ port: exposePort });
if (publicPort !== exposePort) {
throw { message: `Port ${exposePort} is already in use.` };
}
}
return {