From 04bf4cb41f4dbe357bfc0e51c1b0bae177956981 Mon Sep 17 00:00:00 2001 From: Mohammad Ali Shahbazi Date: Wed, 9 Oct 2024 11:46:13 +0330 Subject: [PATCH] Add secondary base url for assets that Uploadcare recommends --- packages/core/src/constants.ts | 1 + packages/core/src/galleries.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index 43298ab4b..788205796 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -1,4 +1,5 @@ export const ASSETS_CDN_URL = 'https://cdn.uc.assets.prezly.com'; +export const ASSETS_SECONDARY_CDN_URL = 'https://ucarecdn.com'; export const DEFAULT_PAGE_SIZE = 12; export const DEFAULT_GALLERY_PAGE_SIZE = 6; export const OG_IMAGE_API_URL = 'https://og.prezly.com/api/og'; diff --git a/packages/core/src/galleries.ts b/packages/core/src/galleries.ts index 8d4604b74..a9603c1a1 100644 --- a/packages/core/src/galleries.ts +++ b/packages/core/src/galleries.ts @@ -1,6 +1,6 @@ import type { NewsroomGallery, UploadedImage } from '@prezly/sdk'; -import { ASSETS_CDN_URL } from './constants'; +import { ASSETS_SECONDARY_CDN_URL } from './constants'; export function isEmpty( gallery: Pick, @@ -36,5 +36,5 @@ export function getArchiveDownloadUrl( // Uploadcare doesn't like slashes in filenames even in encoded form. const filename = encodeURIComponent(title.replace(/\//g, '_')); - return `${ASSETS_CDN_URL}/${uuid}/archive/zip/${filename}.zip`; + return `${ASSETS_SECONDARY_CDN_URL}/${uuid}/archive/zip/${filename}.zip`; }