Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion acceptance/specs/cdn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,8 @@ TEST_CONFIGS.forEach(({ bucketType, accessMethods }) => {
contentType: 'image/png',
})

await pauseForWebhookIfNeeded(accessMethod)
// give cdn webhook time to complete
await delay(5000)

const { route: transform1Route, token: token1 } = await getObjectUrl(
bucketName,
Expand All @@ -978,6 +979,26 @@ TEST_CONFIGS.forEach(({ bucketType, accessMethods }) => {
retries: CACHE_RETRIES,
token: token1,
})

if (accessMethod !== 'public') {
// ensure authenticated assets cannot be accessed via public route cache
const { route: publicTransform1 } = await getObjectUrl(
bucketName,
objectKey,
'public',
'public',
{ transform: { width: 10, height: 10 } }
)

const result = await client.request('GET', publicTransform1, {
expectedCacheStatus: 'BYPASS',
expectedStatus: 400,
})
expect(parseStorageError(result.json)).toMatchObject({
statusCode: '404',
error: 'Bucket not found',
})
}
Comment thread
itslenny marked this conversation as resolved.
} finally {
await cleanupRestObjects(bucketName, [objectKey], client)
}
Comment thread
itslenny marked this conversation as resolved.
Expand Down