@adminforth/storage-adapter-local 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -276,7 +276,9 @@ class AdminForthStorageAdapterLocalFilesystem {
276
276
  }, (err) => {
277
277
  if (err) {
278
278
  afLogger.error(`Could not send file ${filePath}: ${err}`);
279
- res.status(500).send("Could not send file");
279
+ if (!res.headersSent) {
280
+ res.status(500).send("Could not send file");
281
+ }
280
282
  }
281
283
  });
282
284
  }));
package/index.ts CHANGED
@@ -316,7 +316,10 @@ export default class AdminForthStorageAdapterLocalFilesystem implements StorageA
316
316
  (err) => {
317
317
  if (err) {
318
318
  afLogger.error(`Could not send file ${filePath}: ${err}`);
319
- res.status(500).send("Could not send file");
319
+
320
+ if (!res.headersSent) {
321
+ res.status(500).send("Could not send file");
322
+ }
320
323
  }
321
324
  }
322
325
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/storage-adapter-local",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",