Decompress gzip automatically?


This is regarding smack library. In **org.jivesoftware.smack.util.Base64.decode( String s, int options ), **i can see that after base64 decoding, the code tries to detect if the data is gzip compressed and then decompresses it. The API also says this is the behaviour. Can someone please tell me why is the library trying to do so? Is it part of any specification?

The application i am working on is like a proxy to an xmpp server. Therefore it has to return whatever data it gets as it is. This behaviour of decompressing any gzip data is causing issues.



That seems like a bug, maybe

decode( bytes, 0, bytes.length, options )

should be used instead.

Logged as SMACK-404

Thanks for reporting

Thanks for logging the issue.

Just to understand the problem completly: Where exaclty does it cause problems?

I have a REST based web service which sits between a client and xmpp server. The client can call the rest apis to interact with the xmpp server indirectly. The web service should return whatever data it gets as-is, without trying to decompress any gzip data that may come.

I’ve commited a fix. Please grab the source and report back if this fixes the problem for you