浏览代码

companion: check env for truthy value (#2283)

fixes #2066
Ifedapo .A. Olarewaju 5 年之前
父节点
当前提交
29e2af05e4
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      packages/@uppy/companion/src/standalone/helper.js

+ 3 - 2
packages/@uppy/companion/src/standalone/helper.js

@@ -94,8 +94,9 @@ const getConfigFromEnv = () => {
  * @returns {string}
  * @returns {string}
  */
  */
 const getSecret = (baseEnvVar) => {
 const getSecret = (baseEnvVar) => {
-  return `${baseEnvVar}_FILE` in process.env
-    ? fs.readFileSync(process.env[`${baseEnvVar}_FILE`]).toString()
+  const secretFile = process.env[`${baseEnvVar}_FILE`]
+  return secretFile
+    ? fs.readFileSync(secretFile).toString()
     : process.env[baseEnvVar]
     : process.env[baseEnvVar]
 }
 }