You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Link relay: a prepared body shorter than its declared Content-Length is forwarded as complete #8604
From the fresh final review of #8594 at 47b9890 (approved with this one nit).
readDeclaredBody in src/client/link-request-compression.ts returns the shorter slice when a compressible request body ends cleanly before its declared Content-Length, and the relay (src/client/link-relay.ts, the prepared-body path) then rewrites Content-Length to that shorter length. The Home receives a body that looks complete, although the client declared more. The streamed path keeps the declared length, so there the Home sees a short upload.
In practice the truncated JSON almost always fails to parse and the request ends in a 400. Whether Bun ever ends a request body cleanly when it is short was not checked, so this may be unreachable.
Smallest fix: in readDeclaredBody, treat filled !== declared as unreadable and throw; the relay already maps that to a 400. Add a test with a body shorter than its declared length.
Activity
fix(link): refuse a prepared relay body that ends before its declared…