From 960a36817561e70682ca2c83ec92f6246e3faa4e Mon Sep 17 00:00:00 2001 From: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Date: Wed, 12 Mar 2025 10:53:17 +0000 Subject: [PATCH] fix sentry errors (#20005) --- apps/web/app/api/avatar/[uuid]/route.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/app/api/avatar/[uuid]/route.ts b/apps/web/app/api/avatar/[uuid]/route.ts index c6e9a59083..1ec20964d0 100644 --- a/apps/web/app/api/avatar/[uuid]/route.ts +++ b/apps/web/app/api/avatar/[uuid]/route.ts @@ -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,", "");