mirror of
https://github.com/aljazceru/goose.git
synced 2026-02-11 01:24:24 +01:00
feat: disallow env vars for extensions with spaces in the name (#2066)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user