You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to add swagger-express-validator to a code base and found that an API returning PDFs fetched from Google cloud storage started returning 0 bytes. This was a surprise and it took me a while to realise adding swagger-express-validator was the cause. The code is quite simple, lots of examples recommend this pattern:
const gcsBucket = gcs.bucket(bucketName);
result = await gcsBucket
.file(gcsFilePath)
.createReadStream()
.on("error", function (err) {
console.log("Error downloadFileFromGcs");
console.log(err);
throw new ApiError(404, 'Not found');
})
.on("end", function () {
// The file is fully downloaded.
console.log("downloadFileFromGcs: The file is fully downloaded.");
})
.pipe(res);
The text was updated successfully, but these errors were encountered:
I tried to add swagger-express-validator to a code base and found that an API returning PDFs fetched from Google cloud storage started returning 0 bytes. This was a surprise and it took me a while to realise adding swagger-express-validator was the cause. The code is quite simple, lots of examples recommend this pattern:
The text was updated successfully, but these errors were encountered: