From b4383c73364745652f25fc3bf96c216a143f81d9 Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Sun, 5 May 2024 23:58:48 +0700 Subject: [PATCH] disable ref header --- src/app/api/stream/[encryptedId]/route.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/api/stream/[encryptedId]/route.ts b/src/app/api/stream/[encryptedId]/route.ts index 71448c0..921f894 100644 --- a/src/app/api/stream/[encryptedId]/route.ts +++ b/src/app/api/stream/[encryptedId]/route.ts @@ -25,14 +25,15 @@ export async function GET( if (!token) throw new Error("Token not found"); // Only allow if referrer is from the same site - if (!request.headers.get("Referer")?.includes(config.basePath)) { - throw new Error("Invalid request"); - } + // if (!request.headers.get("Referer")?.includes(config.basePath)) { + // throw new Error("Invalid request"); + // } const tokenValidity = await CheckDownloadToken(token); if (!tokenValidity.success) throw new Error(tokenValidity.message); const decryptedId = await decryptData(encryptedId); + const fileMeta = await gdrive.files.get({ fileId: decryptedId, fields: "id, name, mimeType, size, fileExtension, webContentLink",