feat: disallow env vars for extensions with spaces in the name (#2066)

This commit is contained in:
Alex Hancock
2025-04-07 16:20:25 -04:00
committed by GitHub
parent 101e0acab8
commit 63623733dc

View File

@@ -30,6 +30,7 @@ export default function EnvVarsSection({
const handleAdd = () => {
const keyEmpty = !newKey.trim();
const valueEmpty = !newValue.trim();
const keyHasSpaces = newKey.includes(' ');
if (keyEmpty || valueEmpty) {
setInvalidFields({
@@ -40,6 +41,15 @@ export default function EnvVarsSection({
return;
}
if (keyHasSpaces) {
setInvalidFields({
key: true,
value: false,
});
setValidationError('Variable name cannot contain spaces');
return;
}
setValidationError(null);
setInvalidFields({ key: false, value: false });
onAdd(newKey, newValue);