From cd75d652717ae8b5c7b9b6576c9aad533fd7ab0a Mon Sep 17 00:00:00 2001 From: Namekuji Date: Fri, 18 Aug 2023 05:01:19 -0400 Subject: [PATCH] fix: exclude localhost --- packages/backend/src/services/drive/upload-from-url.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/services/drive/upload-from-url.ts b/packages/backend/src/services/drive/upload-from-url.ts index e3ee875c5..d9d68d03c 100644 --- a/packages/backend/src/services/drive/upload-from-url.ts +++ b/packages/backend/src/services/drive/upload-from-url.ts @@ -41,7 +41,8 @@ export async function uploadFromUrl({ const parsedUrl = new URL(url); if ( process.env.NODE_ENV === "production" && - PRIVATE_IP.test(parsedUrl.hostname) + (PRIVATE_IP.test(parsedUrl.hostname) || + parsedUrl.hostname.includes("localhost")) ) { throw new Error("Private IP is not allowed"); }