From 933c4a7f5ea10b4311a39eb7ba7c56d65bd0efce Mon Sep 17 00:00:00 2001 From: 7f8ddd <141754874+7f8ddd@users.noreply.github.com> Date: Sun, 26 May 2024 19:10:44 -0500 Subject: [PATCH] Make "isProduction" default to false unless in development This is much safer than assuming the user has their environment set to production. This causes, for example, /bun:info to leak information, when the environment isn't explicitly set to production. --- src/error.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/error.ts b/src/error.ts index fc85c406..e3a2dd23 100644 --- a/src/error.ts +++ b/src/error.ts @@ -16,7 +16,7 @@ export const ERROR_CODE = Symbol('ElysiaErrorCode') export const ELYSIA_RESPONSE = Symbol('ElysiaResponse') export type ELYSIA_RESPONSE = typeof ELYSIA_RESPONSE -export const isProduction = (env?.NODE_ENV ?? env?.ENV) === 'production' +export const isProduction = (env?.NODE_ENV ?? env?.ENV) !== 'development' export type ElysiaErrors = | InternalServerError