@meebon/meebon-crypto 1.2.18 → 1.2.19

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -94,13 +94,14 @@ function EncryptionMiddleware({ privateKey, publicKey, forRequest }) {
94
94
  } else {
95
95
  const originalSend = res.send.bind(res);
96
96
  res.send = (body) => {
97
+ let encryptData = JSON.parse(body);
97
98
  try {
98
- if (typeof body === "string" && body) {
99
- const decrypted = MeebonCrypto.encryptData(body, publicKey);
99
+ if (encryptData) {
100
+ const decrypted = MeebonCrypto.encryptData(encryptData.data, publicKey);
100
101
  try {
101
- body = JSON.parse(decrypted);
102
+ encryptData.data = JSON.parse(decrypted);
102
103
  } catch {
103
- body = decrypted;
104
+ encryptData.data = decrypted;
104
105
  }
105
106
  }
106
107
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meebon/meebon-crypto",
3
- "version": "1.2.18",
3
+ "version": "1.2.19",
4
4
  "description": "",
5
5
  "author": "kajalanS <103587022+kajalanS@users.noreply.github.com>",
6
6
  "homepage": "https://github.com/KsoftmHub/meebon-crypto?tab=readme-ov-file#getting-started",