Skip to content

Commit e87c096

Browse files
committed
fix replaceSecretPlaceholder: disable secret substitution only for cors=allowAll
1 parent 39578d6 commit e87c096

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

js/server_functions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ function getStartup (req, res) {
2222
* @returns {string} the input with real variable content
2323
*/
2424
function replaceSecretPlaceholder (input) {
25-
if (global.config.cors === "allowWhitelist") {
25+
if (global.config.cors !== "allowAll") {
2626
return input.replaceAll(/\*\*(SECRET_[^*]+)\*\*/g, (match, group) => {
2727
return process.env[group];
2828
});
2929
} else {
30-
Log.error("Replacing secrets works only with CORS and `allowWhitelist`, you need to set this in `config.js`, set `cors: allowWhitelist`");
30+
Log.error("Replacing secrets doesn't work with CORS `allowAll`, you need to set `cors` to `disabled` or `allowWhitelist` in `config.js`");
3131
return input;
3232
}
3333
}

0 commit comments

Comments
 (0)