fix: fix add api auth

This commit is contained in:
Fred Liang
2023-12-24 03:05:23 +08:00
parent 45798f993d
commit 4169431f2c
3 changed files with 7 additions and 10 deletions

View File

@@ -43,9 +43,8 @@ async function handle(
10 * 60 * 1000,
);
const fetchUrl = `${baseUrl}/${path}?key=${req.nextUrl.searchParams.get(
"key",
)}`;
const key = req.nextUrl.searchParams.get("key") ?? serverConfig.googleApiKey;
const fetchUrl = `${baseUrl}/${path}?key=${key}`;
const fetchOptions: RequestInit = {
headers: {