Skip to content

Commit

Permalink
fix(provider/cf): allow only alphanumeric and '_' for env variable keys
Browse files Browse the repository at this point in the history
Co-Authored-By: Stu Pollock <spollock@pivotal.io>
  • Loading branch information
2 people authored and jkschneider committed Nov 9, 2018
1 parent a6f6b07 commit 90e6864
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,14 @@ class ConfigurationSettingsImpl extends React.Component<ICloudFoundryServerGroup
errors.manifest = errors.manifest || {};
errors.manifest.env = `An environment variable was not set`;
} else {
if (e.key) {
const validKeyRegex = /^\w+$/g;
if (!validKeyRegex.exec(e.key)) {
errors.manifest = errors.manifest || {};
errors.manifest.env =
`'` + e.key + `' is an invalid environment variable name and must be alphanumeric`;
}
}
const value = existingKeys[e.key];
if (!value) {
existingKeys[e.key] = e.value;
Expand Down

0 comments on commit 90e6864

Please sign in to comment.