From b612d2327d6bc38e6d730f4c1c4e4b8b4328b707 Mon Sep 17 00:00:00 2001 From: skidoodle Date: Wed, 13 Dec 2023 15:09:16 +0100 Subject: [PATCH] HMMMM --- src/components/Buttons.tsx | 4 +--- src/pages/api/erettsegi.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/Buttons.tsx b/src/components/Buttons.tsx index 8a66db5..56bed3c 100644 --- a/src/components/Buttons.tsx +++ b/src/components/Buttons.tsx @@ -11,9 +11,7 @@ const CustomButton: React.FC = ({ label, link }) => { if (link) { try { setIsLoading(true) - const response = await fetch( - `/api/validate?link=${encodeURIComponent(link)}` - ) + const response = await fetch(`/api/validate?link=${encodeURI(link)}`) const data = (await response.json()) as { status: number } setStatus(data.status) } catch (error) { diff --git a/src/pages/api/erettsegi.ts b/src/pages/api/erettsegi.ts index 91964d6..999537d 100644 --- a/src/pages/api/erettsegi.ts +++ b/src/pages/api/erettsegi.ts @@ -14,7 +14,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) { const address = req.headers.host const baseUrl = `https://dload-oktatas.educatio.hu/erettsegi/feladatok_${ev}${idoszak}_${szint}/` - const proxiedUrl = `${protocol}://${address}/api/proxy?link=${encodeURIComponent( + const proxiedUrl = `${protocol}://${address}/api/proxy?link=${encodeURI( baseUrl )}`