read_request() in the Rust gateway's HTTP transport only ever looked at Content-Length to size the request body. A chunked request (Transfer-Encoding: chunked, no Content-Length) made content_length default to 0, so the body was silently truncated to empty and forwarded to the backend while the real chunked bytes were left unread on the connection — desynchronizing the next request parsed from that same socket (request smuggling), or just silently dropping a real client's upload with no error at all. The sibling Python prototype (lawsynth_gateway/app.py) already rejects any Transfer-Encoding header with 400 unsupported_transfer_encoding; the Rust rewrite dropped that check. Add it back as a new ReadOutcome variant handled in server.rs, with a regression test.
LawSynth gateway
This package is the transport-independent WSGI admission layer in front of the
local lawsynth-api application. It canonicalizes headers, rejects oversized
or malformed bodies, enforces an exact-origin CORS policy, creates request IDs,
applies a bounded sliding-window limit, and exposes /healthz and /readyz.
Compose it in the process hosting the API:
from lawsynth_api import create_wsgi_app
from lawsynth_gateway import create_gateway
application = create_gateway(create_wsgi_app())
Only an in-process WSGI backend is implemented. Remote upstream proxying, TLS termination, and retry behavior are explicitly unavailable; they must be provided by an audited edge proxy rather than simulated by this process.