allow 80 or 443 raw resources

This commit is contained in:
Milo Schwartz 2025-02-04 21:39:13 -05:00
parent bc0b467f1a
commit b6963a9c35
No known key found for this signature in database
2 changed files with 22 additions and 22 deletions

View file

@ -79,17 +79,17 @@ const createResourceSchema = z
message: "Proxy port cannot be set" message: "Proxy port cannot be set"
} }
) )
.refine( // .refine(
(data) => { // (data) => {
if (data.proxyPort === 443 || data.proxyPort === 80) { // if (data.proxyPort === 443 || data.proxyPort === 80) {
return false; // return false;
} // }
return true; // return true;
}, // },
{ // {
message: "Port 80 and 443 are reserved for http and https resources" // message: "Port 80 and 443 are reserved for http and https resources"
} // }
) // )
.refine( .refine(
(data) => { (data) => {
if (!config.getRawConfig().flags?.allow_base_domain_resources) { if (!config.getRawConfig().flags?.allow_base_domain_resources) {

View file

@ -46,17 +46,17 @@ const updateResourceBodySchema = z
}, },
{ message: "Cannot update proxyPort" } { message: "Cannot update proxyPort" }
) )
.refine( // .refine(
(data) => { // (data) => {
if (data.proxyPort === 443 || data.proxyPort === 80) { // if (data.proxyPort === 443 || data.proxyPort === 80) {
return false; // return false;
} // }
return true; // return true;
}, // },
{ // {
message: "Port 80 and 443 are reserved for http and https resources" // message: "Port 80 and 443 are reserved for http and https resources"
} // }
) // )
.refine( .refine(
(data) => { (data) => {
if (!config.getRawConfig().flags?.allow_base_domain_resources) { if (!config.getRawConfig().flags?.allow_base_domain_resources) {