Skip to Content
0
Jan 12 at 04:13 PM

CAP - Custom Header/Compression

230 Views Last edit Jan 12 at 04:22 PM 4 rev

Dear Experts,

we need to compress as much as possible the amount of data we are transferring through a custom action.
We wish we could use gzip compression, which we are able to do, but we cannot set the response header with 'Content-Encoding' equal to 'gzip', consequently the front-end (SAPUI5) fails to convert it.

Action definition:

immagine-2022-01-12-170520.jpg

Action handler:

const { gzip, ungzip } = require("node-gzip");

immagine-2022-01-12-170601.jpg

We want that in the front-end we can get the string and then make a JSON parse, but this is what we get:

immagine-2022-01-12-172043.jpg

How can we achieve this?

Thanks

Kevin