To close this for the archive and for anyone who needs this in the future:

In Jetty the GzipHandler has a number of defaults that will limit what it does unless explicitly overridden.

For example it will compress responses only with GET requests and will not decompress requests.

The configuration of the GzipHandler in BaseX has been changed (thank you Christian!):

• It now explicitly includes POST and PUT methods
• The inflate buffer size is set greater than 0 - which enables transparent decompression of gzipped requests

So something like:

echo '<Test/>' | gzip | curl -v -H "Content-Type: text/xml" -H "Content-Encoding: gzip" --data-binary @- http://localhost:8984/yourFunction

will now deliver XML to yourFunction on a system that has GZIP set to true.

Regards, James

On 4 Nov 2021, at 08:22, Christian Grün <christian.gruen@gmail.com> wrote:

Hi James,

This is due to the default gzip settings of Jetty, which exclude POST
requests. There had been a similar question in the past, and I have
now decided to add the POST and PUT method to the Jetty defaults
[1,2].

A new snapshot is available!

Cheers,
Christian

[1] https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg12281.html
[2] https://github.com/BaseXdb/basex/issues/1748



On Tue, Nov 2, 2021 at 6:29 PM James Ball <basex-talk@jamesball.co.uk> wrote:

Hello,

I have a RESTXQ function that receives an XML file via HTTP POST. This works perfectly.

The client would now like to compress the data with gzip and set the Content-Encoding: gzip header.

I set GZIP = true in my .basex file based on the documentation [1]

But these gzipped post requests fail - my function is called but content seems to arrive at my function still compressed.

(Responses from the server become compressed dynamically as expected - and that works great).

Is there something else I need to do to make it work for requests?

Many thanks, James


[1] https://docs.basex.org/wiki/Options#GZIP