mirror of
https://github.com/skidoodle/erettsegi-browser.git
synced 2025-02-15 05:39:15 +01:00
HMMMM
This commit is contained in:
parent
5e46ceb833
commit
b612d2327d
2 changed files with 2 additions and 4 deletions
|
@ -11,9 +11,7 @@ const CustomButton: React.FC<ButtonProps> = ({ label, link }) => {
|
||||||
if (link) {
|
if (link) {
|
||||||
try {
|
try {
|
||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
const response = await fetch(
|
const response = await fetch(`/api/validate?link=${encodeURI(link)}`)
|
||||||
`/api/validate?link=${encodeURIComponent(link)}`
|
|
||||||
)
|
|
||||||
const data = (await response.json()) as { status: number }
|
const data = (await response.json()) as { status: number }
|
||||||
setStatus(data.status)
|
setStatus(data.status)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||||
const address = req.headers.host
|
const address = req.headers.host
|
||||||
|
|
||||||
const baseUrl = `https://dload-oktatas.educatio.hu/erettsegi/feladatok_${ev}${idoszak}_${szint}/`
|
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
|
baseUrl
|
||||||
)}`
|
)}`
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue