mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-08 03:36:37 +00:00
prevent raw tcp on port 80 or 443
This commit is contained in:
@@ -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) {
|
if (proxyPort === 443 || proxyPort === 80) {
|
||||||
return next(
|
return next(
|
||||||
createHttpError(
|
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
|
// make sure the full domain is unique
|
||||||
const existingResource = await db
|
const existingResource = await db
|
||||||
.select()
|
.select()
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ export default function ReverseProxyTargets(props: {
|
|||||||
defaultValues: {
|
defaultValues: {
|
||||||
ip: "",
|
ip: "",
|
||||||
method: resource.http ? "http" : null,
|
method: resource.http ? "http" : null,
|
||||||
port: resource.http ? 80 : resource.proxyPort || 1234
|
port: ""
|
||||||
// protocol: "TCP",
|
// protocol: "TCP",
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user