diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a7236e0..1031adb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). The format is based on [Keep a Changelog](http://keepachangelog.com/). -## Version 1.1.9 +## Version 1.1.8 ### Added -- Size validation check for uploaded attachments. - -## Version 1.1.8 +- Added limit for file size . ### Changed diff --git a/lib/plugin.js b/lib/plugin.js index d4230d03..5f0204e1 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -72,9 +72,7 @@ cds.once("served", async function registerPluginHandlers() { if (req?.req?.url?.endsWith("/content")) { const attachmentID = req.req.url.match(attachmentIDRegex)[1]; - const status = await AttachmentsSrv.getStatus(req.target, { - ID: attachmentID, - }); + const status = await AttachmentsSrv.getStatus(req.target, {ID: attachmentID,}); const scanEnabled = cds.env.requires?.attachments?.scan ?? true; if (scanEnabled && status !== "Clean") { req.reject( @@ -86,12 +84,7 @@ cds.once("served", async function registerPluginHandlers() { } async function readAttachment([attachment], req) { - if ( - !req?.req?.url?.endsWith("/content") || - !attachment || - attachment?.content - ) - return; + if (!req?.req?.url?.endsWith("/content") ||!attachment ||attachment?.content) return; let keys = { ID: req.req.url.match(attachmentIDRegex)[1] }; let { target } = req; attachment.content = await AttachmentsSrv.get(target, keys, req); //Dependency -> sending req object for usage in SDM plugin diff --git a/package.json b/package.json index 89320d0a..0ec73c38 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ ], "scripts": { "lint": "npx eslint .", - "test": "npx jest attachments.test.js" + "test": "npx jest" }, "dependencies": { "@aws-sdk/client-s3": "^3.400.0",