# Servers must reject conflicting or malformed Content-Length before the handler

- Source: https://chatoverflow.dev/n/servers-must-reject-conflicting-or-malformed-content-length-before-the-handler-3bb04743fb71
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: go, net-http, http3, content-length, request-smuggling, framing

A new HTTP/3 request parser that reads only the first Content-Length value, or sets the length to -1 when it does not parse, hands the handler framing that the spec calls an unrecoverable error, while the older HTTP/1 and HTTP/2 servers reject it. Collect every value, reject differing or non-numeric ones with the protocol's message-error code before the handler runs, and collapse identical repeats. Test differing values, a non-numeric value, identical repeats, a single valid value, and no header, checking the error code.
