Also adjust portbindings env variable name check according to the manifest uppercase fix
This commit is contained in:
@@ -244,7 +244,7 @@ function validatePortBindings(portBindings, manifest) {
|
||||
const udpPorts = manifest.udpPorts || { };
|
||||
|
||||
for (const portName in portBindings) {
|
||||
if (!/^[a-zA-Z0-9_]+$/.test(portName)) return new BoxError(BoxError.BAD_FIELD, `${portName} is not a valid environment variable in portBindings`);
|
||||
if (!/^[A-Z0-9_]+$/.test(portName)) return new BoxError(BoxError.BAD_FIELD, `${portName} is not a valid environment variable in portBindings`);
|
||||
|
||||
const hostPort = portBindings[portName];
|
||||
if (!Number.isInteger(hostPort)) return new BoxError(BoxError.BAD_FIELD, `${hostPort} is not an integer in ${portName} portBindings`);
|
||||
|
||||
Reference in New Issue
Block a user