Issue with Jetty on POST/PUT/PATCH with empty content (consider disabling gzip all the time) #1548
Labels
priority: p4
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
When a HTTP request has an empty content (no payload) for a POST/PUT/PATCH, a Jetty server fails with the following stack for a client request created by this API with the default parameters:
It fails to analyse parameters because the content-size is not set and the headers are not consistent. Here are the default headers:
On a previous version of this lib, the Content-Size was set to 27, which is the compression of the empty content.
When the compression is disabled (
.setDisableGZipContent(true)
), the headers are ok and it works well with Jetty:For this kind of request in particular, with empty content in general (when the content size can be determined), the field
disableGZipContent
in the classAbstractGoogleClientRequest
should be ignored and the compression always disabled. This will avoid some tricky errors with the default parameters of anAbstractGoogleClientRequest
and avoid unnecessary compression.In
com.google.api.client.googleapis.services.AbstractGoogleClientRequest
, around line 426, there is a few lines handling this kind of requestYou may force the disabling of the compression just after to really have the
Content-Length header
.The text was updated successfully, but these errors were encountered: