Skip to content

Commit fd779ee

Browse files
committed
fix: only set env if undefined at first
1 parent 6fe9839 commit fd779ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/runtime/env.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { eventHandler } from 'h3'
44
export default eventHandler((event) => {
55
const env = event.context.cloudflare?.env || {}
66
for (const key in env) {
7-
process.env[key] = process.env[key] || env[key]
7+
// Only set env if process.env[key] is undefined and env[key] is not a binding
8+
if (typeof process.env[key] === 'undefined' && typeof env[key] === 'string') {
9+
process.env[key] = env[key]
10+
}
811
}
912
})

0 commit comments

Comments
 (0)