Membrane API Gateway returns 400 Bad Request with the title Request body could not be decoded when the ws-security plugin cannot decompress the request body with the Content-Encoding the client declared.
The response contains the status 400, the title Request body could not be decoded, the problem type https://membrane-api.io/problems/user/body-decoding and a link to this page. The type user means that the client caused the problem. The extra field contentEncoding names the encoding that failed. It is also sent in production mode.
The request is labelled Content-Encoding: gzip, deflate or br, but the body is not in that format, for example plain JSON labelled as gzip.
The compressed stream ends early or is damaged. A gzip body cut off inside its trailer is reported as EOFException.
Because the body has a Content-Encoding, a connection that breaks while the body is being read is reported as a decoding failure too.
Content-Encoding, or leave the header out for an uncompressed body.detail field quotes the decoder's error.Membrane decodes only gzip, deflate and br. Bodies with other Content-Encoding values are passed through without decoding and do not cause this error.
By default, Membrane runs in development mode and adds details to error responses that help you find the problem. These details may reveal information about your setup. In production, turn them off:
configuration:
production: trueconfiguration: production: true
Add the configuration document to your apis.yaml and separate it from the APIs with ---.
Configuration reference:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.