Skip to content

Commit 10a626f

Browse files
authored
Merge pull request #182 from gaiin-platform/bug-fix/payload-error
Remove payload compression logic from requestOp API handler
2 parents 630e2dc + 3ec0ea2 commit 10a626f

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

pages/api/requestOp.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,6 @@ const requestOp =
4242
},
4343
}
4444

45-
if (payload) {
46-
const shouldCompress = !NO_COMPRESSION_PATHS.includes(reqData.path);
47-
48-
if (shouldCompress) {
49-
try {
50-
if (typeof payload === 'object') {
51-
payload = lzwCompress(JSON.stringify(payload));
52-
console.log("Compressed payload");
53-
} else if (typeof payload === 'string' && payload.length > 1000) {
54-
// Compress large strings
55-
payload = lzwCompress(payload);
56-
console.log("Compressed payload");
57-
}
58-
} catch (e) {
59-
console.error("Error in requestOp: ", e);
60-
console.log("Sending uncompressed payload");
61-
}
62-
} else {
63-
console.log(`Skipping compression for path: ${reqData.path}`);
64-
}
65-
reqPayload.body = JSON.stringify( { data: payload });
66-
67-
}
6845
if (payload) {
6946
const shouldCompress = !NO_COMPRESSION_PATHS.includes(reqData.path);
7047

0 commit comments

Comments
 (0)