Forum Discussion
uncompress gzip REQUEST with JSON
The CLIENT compresses the REQUESTS sent to the server. right now, I don't care if the server will decompress or F5 - what I'm interseted in, is to apply my ASM policy (parameters, lengths, signatures, etc.) to the JSON payload coming from the CLIENT in the REQUSET.
The problem is that the policy in ASM is not applied to the content bacause ASM only sees the gzip binary data and not the JSON text.
Here is a sample REQUEST, as logged in ASM (header values modified a bit to protect customer info):
POST /endpoint/service/?param1=AAADDD HTTP/1.1
Accept: application/json
Content-type: application/json
Content-Encoding: gzip
User-Agent: CUSTOM
Host: example.com:21499
Connection: Keep-Alive
Content-Length: 12547
Y�Ɇ���Ȼ�|{���>,>6>M�)�ɖɦ����w�(R�UwvV553��bvfB�*o'2O������n�]�}>{wFB�sA�$�N���R��_��_��[��Շ5��b�ݮ~={��y���'�ۿ�����fs�_%1(�������������nu��g����މA������vu;a��z�o7��7�dzw�������?��rs7|~���\߮ReplaceWith?���������~�
Fc0��?������4٘�z�V��TF9��bKƄ��e$�珛����g�AyE�� U!H������M�Ұ����p��_�<<~��<|~�/��\?>�] M���MW��pNAI�CpB��
���,�R��6t�vR��0�ߜ/�u�\|�l>ܮ_����p��ps
I also encountered something similar. The response you have is a binary. It is not a valid gzip.
Let's supposeout is the ByteArrayOutputStream used by your GZIPOutputStream. Encode your output to Base64 like this :
String compressedResponse = Base64.getEncoder().encodeToString( out.toByteArray() );
Then your response will be unzippable.
I hope this helps !
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
