Check for blank string

This commit is contained in:
Mel O'Hagan 2022-06-15 13:16:30 +01:00
parent cdf069abbc
commit ca04f3be6f
1 changed files with 4 additions and 1 deletions

View File

@ -114,7 +114,10 @@ exports.getSignedUploadURL = async function (ctx) {
// Determine type of datasource and generate signed URL
let signedUrl
let publicUrl
const AWS_REGION = datasource?.config?.region ?? "eu-west-1"
const AWS_REGION =
datasource?.config?.region?.length > 0
? datasource?.config?.region
: "eu-west-1"
if (datasource.source === "S3") {
const { bucket, key } = ctx.request.body || {}
if (!bucket || !key) {