From 17814b3478a1196129a8c7265718e0ef47d5b3bc Mon Sep 17 00:00:00 2001 From: split Date: Wed, 20 Nov 2024 07:40:49 -0800 Subject: [PATCH] fix: :bug: redirecting to 404 --- src/routes/user/[identifier]/source/+server.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/routes/user/[identifier]/source/+server.ts b/src/routes/user/[identifier]/source/+server.ts index 0a0a325..767a83c 100644 --- a/src/routes/user/[identifier]/source/+server.ts +++ b/src/routes/user/[identifier]/source/+server.ts @@ -1,10 +1,10 @@ -import { getMetadataForIdentifier } from '$lib/avatars.js'; -import { error, redirect } from '@sveltejs/kit'; +import { getMetadataForIdentifier } from "$lib/avatars.js" +import { error, redirect } from "@sveltejs/kit" -export async function GET({ params : { identifier } }) { +export async function GET({ params: { identifier } }) { let { source } = await getMetadataForIdentifier(identifier) - let finalUrl: URL | string = `/info/${identifier}` - + let finalUrl: URL | string = `/user/${identifier}` + if (source) { try { finalUrl = new URL(source) @@ -12,4 +12,4 @@ export async function GET({ params : { identifier } }) { } throw redirect(302, finalUrl) -} \ No newline at end of file +}