Leverage window.location to avoid CORS issues on new installations
This commit is contained in:
parent
923073fa05
commit
5dcbda1abd
@ -260,7 +260,12 @@ export default function PhotoForm({
|
||||
</div>
|
||||
</div>
|
||||
<CanvasBlurCapture
|
||||
imageUrl={getNextImageUrlForRequest(url, 640)}
|
||||
imageUrl={getNextImageUrlForRequest(
|
||||
url,
|
||||
640,
|
||||
undefined,
|
||||
window.location.origin,
|
||||
)}
|
||||
width={width}
|
||||
height={height}
|
||||
onLoad={aiContent?.setImageData}
|
||||
|
||||
@ -18,9 +18,8 @@ const VERCEL_PRODUCTION_URL = process.env.VERCEL_PROJECT_PRODUCTION_URL;
|
||||
const VERCEL_DEPLOYMENT_URL = process.env.NEXT_PUBLIC_VERCEL_URL;
|
||||
const VERCEL_BRANCH_URL = process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL;
|
||||
const VERCEL_BRANCH = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF;
|
||||
|
||||
// Cannot reliably be used
|
||||
export const VERCEL_PROJECT_URL = VERCEL_BRANCH_URL && VERCEL_BRANCH
|
||||
// Last resort: cannot be used reliably
|
||||
const VERCEL_PROJECT_URL = VERCEL_BRANCH_URL && VERCEL_BRANCH
|
||||
? `${VERCEL_BRANCH_URL.split(`-git-${VERCEL_BRANCH}-`)[0]}.vercel.app`
|
||||
: undefined;
|
||||
|
||||
@ -28,6 +27,7 @@ export const VERCEL_PROJECT_URL = VERCEL_BRANCH_URL && VERCEL_BRANCH
|
||||
const SITE_DOMAIN =
|
||||
process.env.NEXT_PUBLIC_SITE_DOMAIN ||
|
||||
VERCEL_PRODUCTION_URL ||
|
||||
VERCEL_PROJECT_URL ||
|
||||
VERCEL_DEPLOYMENT_URL;
|
||||
|
||||
// Used primarily for absolute references such as OG images
|
||||
|
||||
Loading…
Reference in New Issue
Block a user