prevent raw tcp on port 80 or 443

This commit is contained in:
Milo Schwartz 2025-02-02 15:47:29 -05:00
parent 6a8132546e
commit a7c99b016c
No known key found for this signature in database
2 changed files with 10 additions and 10 deletions

View file

@ -133,15 +133,6 @@ export async function createResource(
)
);
if (existingResource.length > 0) {
return next(
createHttpError(
HttpCode.CONFLICT,
"Resource with that protocol and port already exists"
)
);
}
} else {
if (proxyPort === 443 || proxyPort === 80) {
return next(
createHttpError(
@ -151,6 +142,15 @@ export async function createResource(
);
}
if (existingResource.length > 0) {
return next(
createHttpError(
HttpCode.CONFLICT,
"Resource with that protocol and port already exists"
)
);
}
} else {
// make sure the full domain is unique
const existingResource = await db
.select()