Membrane API Gateway returns 400 Bad Request with a link to this page when its HTTP server receives a request whose header section or body framing is invalid. This happens before any API is selected. Membrane then closes the connection to prevent HTTP request smuggling.
The response contains the status 400 Bad Request, a detail that names the offending header, the problem type https://membrane-api.io/problems/user and a link to this page. The type user means that the client, or a proxy in front of Membrane, sent an invalid request.
The length of an HTTP/1.1 request body is determined by Content-Length or Transfer-Encoding: chunked. If these headers are ambiguous, a proxy and a backend may disagree on where one request ends and the next begins. Attackers use that to smuggle requests past security checks. RFC 9112, section 6.3, therefore requires such requests to be rejected and the connection to be closed.
The request has several Content-Length values that differ, in separate fields or as a comma-separated list, or a Content-Length that is not a non-negative integer.
The last coding in Transfer-Encoding is not chunked, so the length of the body cannot be determined.
A header line has no field name followed by a colon. Most often this is an obsolete folded continuation line, a line that starts with whitespace.
A field name contains whitespace or a control character. This includes whitespace between the field name and the colon, as in Content-Type : text/plain, which is rejected rather than trimmed.
Content-Length, or use Transfer-Encoding: chunked as the final coding, never both in conflicting form.Name: value, with no folding and no whitespace before the colon.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.