Skip to content

Commit

Permalink
Add Studio URL whitelist entry
Browse files Browse the repository at this point in the history
Properly compute the environment variable name for arrays.
  • Loading branch information
Stefan Bethke committed May 6, 2022
1 parent 45307af commit 63aef44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ public Map<String, String> getSpringBootProperties() {
"server.tomcat.accesslog.file-date-format", "",
"server.tomcat.accesslog.pattern", "[ACCESS] %l %t %D %F %B %S",
"server.tomcat.accesslog.rotate", "false",
"com.coremedia.transform.blobCache.basePath", "/coremedia/persistent-cache/transformed-blob"
"com.coremedia.transform.blobCache.basePath", "/coremedia/persistent-cache/transformed-blob",
"cae.preview.pbe.studio-url-whitelist[0]", "https://" + getTargetState().getStudioHostname()
));

if (getComponentSpec().getKind().equals(KIND_LIVE)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ public List<EnvVar> toEnvVars() {

private EnvVar entryToEnvVar(Map.Entry<String, String> e) {
EnvVar env = new EnvVar();
env.setName(e.getKey().replaceAll("[^A-Za-z0-9]+", "_").toUpperCase(Locale.ROOT));
env.setName(e.getKey()
.replaceAll("[^A-Za-z0-9]+", "_")
.replaceAll("_$", "")
.toUpperCase(Locale.ROOT));
env.setValue(e.getValue());
return env;
}
Expand Down

0 comments on commit 63aef44

Please sign in to comment.