Skip to content

Handle GZIP stream correctly #1331

@josvanroosmalen

Description

@josvanroosmalen

Internal Bugtrack reference: 42127

The next major version of MarkLogic Server will support HTTP Chunking and GZIP compression if requested by the request headers.

Some MarkLogic Java Client API unit tests are now failing against this latest MLS build.

Based on a first analysis:

  • The Java Client API is always sending requests that it accepts GZIP (accept-encoding: gzip)
  • The new server is going to respond with a GZIP. The current MLS version is ignoring this, so it sends an uncompressed stream.
  • The Java Client API is producing undesired outcome, because it makes certain assumptions which are not true in case a GZIP stream is delivered. For example body.contentLength() is frequently tested to see the response is empty or not. In case of GZIP this is always -1, so this test result in the wrong program flow.

The goal of this change is to get the Java Client API working with both uncompressed and compressed streams, so that all integration tests runs fine with the current build and next major release of the server.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions