mirror of
https://github.com/skidoodle/erettsegi-browser.git
synced 2026-04-28 13:37:35 +02:00
gotta rewrite this shit go
This commit is contained in:
@@ -8,7 +8,7 @@ const LABELS = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
req: NextRequest,
|
_req: NextRequest,
|
||||||
{ params }: { params: Promise<{ slug: string[] }> },
|
{ params }: { params: Promise<{ slug: string[] }> },
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
@@ -20,11 +20,7 @@ export async function GET(
|
|||||||
const isComplete = subject && year && period && level;
|
const isComplete = subject && year && period && level;
|
||||||
|
|
||||||
if (isComplete) {
|
if (isComplete) {
|
||||||
const protocol =
|
const proxyBase = `/proxy/${subject.slug}/${year}/${period}/${level}`;
|
||||||
req.headers.get("x-forwarded-proto") === "https" ? "https" : "http";
|
|
||||||
const host = req.headers.get("host");
|
|
||||||
|
|
||||||
const proxyBase = `${protocol}://${host}/proxy/${subject.slug}/${year}/${period}/${level}`;
|
|
||||||
const makeLink = (type: string) => `${proxyBase}/${type}`;
|
const makeLink = (type: string) => `${proxyBase}/${type}`;
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
|
|||||||
Reference in New Issue
Block a user