diff --git a/website/server/controllers/top-level/dataexport.js b/website/server/controllers/top-level/dataexport.js index 08bc4a1f8e..9042547a7a 100644 --- a/website/server/controllers/top-level/dataexport.js +++ b/website/server/controllers/top-level/dataexport.js @@ -203,7 +203,8 @@ api.exportUserAvatarPng = { try { response = await got.head(s3url); } catch (gotError) { - if (gotError.code !== 'ENOTFOUND' && gotError.statusCode !== 404) { + // If the file does not exist AWS S3 can return a 403 error + if (gotError.code !== 'ENOTFOUND' && gotError.statusCode !== 404 && gotError.statusCode !== 403) { throw gotError; } }