fix sentry errors (#20005)

This commit is contained in:
sean-brydon
2025-03-12 10:53:17 +00:00
committed by GitHub
parent 49cb86dfe9
commit 960a368175
+3 -2
View File
@@ -4,7 +4,7 @@ import type { NextRequest } from "next/server";
import { NextResponse } from "next/server";
import { z } from "zod";
import { AVATAR_FALLBACK } from "@calcom/lib/constants";
import { AVATAR_FALLBACK, WEBAPP_URL } from "@calcom/lib/constants";
import prisma from "@calcom/prisma";
const querySchema = z.object({
@@ -47,7 +47,8 @@ async function handler(req: NextRequest, { params }: { params: Params }) {
img = data;
} catch (e) {
// If anything goes wrong or avatar is not found, use default avatar
return NextResponse.redirect(AVATAR_FALLBACK, 302);
const url = new URL(AVATAR_FALLBACK, WEBAPP_URL).toString();
return NextResponse.redirect(url, 302);
}
const decoded = img.toString().replace("data:image/png;base64,", "").replace("data:image/jpeg;base64,", "");