From ef59322290a27533d6c2a8f2f41a75d395a541ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Bou=C3=A7as?= Date: Fri, 22 Mar 2024 19:16:12 +0000 Subject: [PATCH] fix: add `uncachedEdgeURL` to Blobs context --- src/lib/blobs/blobs.ts | 5 ++++- tests/integration/commands/dev/dev.config.test.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/blobs/blobs.ts b/src/lib/blobs/blobs.ts index bbe92788e5b..29270846a40 100644 --- a/src/lib/blobs/blobs.ts +++ b/src/lib/blobs/blobs.ts @@ -16,6 +16,7 @@ export interface BlobsContext { edgeURL: string siteID: string token: string + uncachedEdgeURL: string } const printLocalBlobsNotice = () => { @@ -58,11 +59,13 @@ interface GetBlobsContextOptions { export const getBlobsContext = async ({ debug, projectRoot, siteID }: GetBlobsContextOptions) => { const token = uuidv4() const { port } = await startBlobsServer(debug, projectRoot, token) + const url = `http://localhost:${port}` const context: BlobsContext = { deployID: '0', - edgeURL: `http://localhost:${port}`, + edgeURL: url, siteID, token, + uncachedEdgeURL: url, } return context diff --git a/tests/integration/commands/dev/dev.config.test.js b/tests/integration/commands/dev/dev.config.test.js index cccf367d1ad..c68a6a18bb5 100644 --- a/tests/integration/commands/dev/dev.config.test.js +++ b/tests/integration/commands/dev/dev.config.test.js @@ -179,10 +179,13 @@ describe.concurrent('commands/dev/config', () => { t.expect(NETLIFY_BLOBS_CONTEXT).toBeTypeOf('string') - const { deployID, edgeURL, siteID, token } = JSON.parse(Buffer.from(NETLIFY_BLOBS_CONTEXT, 'base64').toString()) + const { deployID, edgeURL, siteID, token, uncachedEdgeURL } = JSON.parse( + Buffer.from(NETLIFY_BLOBS_CONTEXT, 'base64').toString(), + ) t.expect(deployID).toBe('0') t.expect(edgeURL.startsWith('http://localhost:')).toBeTruthy() + t.expect(uncachedEdgeURL.startsWith('http://localhost:')).toBeTruthy() t.expect(siteID).toBeTypeOf('string') t.expect(token).toBeTypeOf('string')