From 6f7707514b7a3b9b205bd2b1bd09d1945d58cf72 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 14 Jun 2025 22:57:43 -0400 Subject: [PATCH] fix stupid cors issue with gallery --- .../components/lightbox-modal/src/lib/lightbox-modal.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/libs/components/lightbox-modal/src/lib/lightbox-modal.tsx b/frontend/libs/components/lightbox-modal/src/lib/lightbox-modal.tsx index 773cbaf7f7..03bc642558 100644 --- a/frontend/libs/components/lightbox-modal/src/lib/lightbox-modal.tsx +++ b/frontend/libs/components/lightbox-modal/src/lib/lightbox-modal.tsx @@ -46,6 +46,11 @@ export function LightboxModal({ onAddToSceneClicked, mediaClass, }: LightboxModalProps) { + // NB(bt,2025-06-14): We add ?cors=1 to the image url to prevent caching "sec-fetch-mode: no-cors" from + // the tag request from being cached. If we then drag it into the canvas after it's been cached, + // it won't be able to load in cors mode and will show blank in the canvas and 3D engine. This is a really + // stupid hack around this behavior. + const imageTagImageUrl = imageUrl ? imageUrl + "?cors=1" : ""; return createPortal(
@@ -102,7 +107,7 @@ export function LightboxModal({ ) : (