HTTP 400 Invalid Message: Both Content-Length and Transfer-Encoding Present

RFC 9112 forbids sending both headers together (request smuggling defense).

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: HTTP 400 Invalid Message Platform: HTTP
Common Root Causes:
  • RFC 9112 forbids sending both headers together (request smuggling defense).

Interactive Diagnostic Checklist

Verified Solutions:
  1. Send either `Content-Length` OR `Transfer-Encoding: chunked`, never both.
Safe Diagnostic Command:
Inspect raw proxy/client outgoing headers
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

RFC 9112 forbids sending both headers together (request smuggling defense). Recommended diagnostic: `Inspect raw proxy/client outgoing headers`. Remediation: Send either `Content-Length` OR `Transfer-Encoding: chunked`, never both.

Worked Examples

  • Run `Inspect raw proxy/client outgoing headers` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-http-chunked-transfer-content-length · Independently verified: 2026-11-25

Related Resources