Closed shiny closed 3 months ago
According to the Flydrive document, the default CDN URL should be composed of cdnUrl + filename
cdnUrl
filename
const disk = new Disk( new S3Driver({ cdnUrl: 'https://assets.myapp.com', endpoint: 'https://jg21.r2.cloudflarestorage.com', bucket: 'testing-drive', }) ) const URL = await disk.getUrl('avatar.png') console.log(URL) // https://assets.myapp.com/avatar.png
But actually the result is cdnUrl + bucket + filename https://github.com/flydrive-js/core/blob/85628e9daf476389e98a55ea8611f7ec7e78dc4e/drivers/s3/driver.ts#L406
bucket
In cloudflare R2, bucket is not a part of public URL. for a temporary fix, we can specify a urlBuilder callback for the correct format.
Fixed in https://github.com/flydrive-js/core/commit/11ab6ce27b02d0b5f34f212a2893c2ab9e8ef0fe
Fixed in https://github.com/flydrive-js/core/releases/tag/v1.0.3
According to the Flydrive document, the default CDN URL should be composed of
cdnUrl
+filename
But actually the result is
cdnUrl
+bucket
+filename
https://github.com/flydrive-js/core/blob/85628e9daf476389e98a55ea8611f7ec7e78dc4e/drivers/s3/driver.ts#L406