Prevent generating presigned URLs for any S3 datasources that use custom endpoints

This commit is contained in:
Andrew Kingston 2022-01-24 15:18:42 +00:00
parent 157b6a19f6
commit b3bd38c6fc
1 changed files with 5 additions and 0 deletions

View File

@ -122,6 +122,11 @@ exports.getSignedUploadURL = async function (ctx) {
ctx.throw(400, "The specified datasource could not be found") ctx.throw(400, "The specified datasource could not be found")
} }
// Ensure we aren't using a custom endpoint
if (datasource?.config?.endpoint) {
ctx.throw(400, "S3 datasources with custom endpoints are not supported")
}
// Determine type of datasource and generate signed URL // Determine type of datasource and generate signed URL
let signedUrl let signedUrl
let publicUrl let publicUrl