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
[BUG] Server should return 400 Bad request if not all body bytes received #4169
Our endpoint receives the PUT request with JSON body from mobile clients. As mobile network may be unstable some requests are interrupted before receiving the full request body.
We set NettyConfig.requestTimeout to 5s to make sure we close the connection from the server side. Then channel is marked inactive. When org.playframework.netty.HandlerPublisher receives channelInactive it completes by calling SimpleSubscriber.onComplete which sends all received bytes. As a result corrupted JSON is passed to the Codec.
What is the problem?
I'd propose if the number of bytes received is lower than the expected content length do not pass the bytes to the codec
@akozich I've prepared a draft #4214 where I've tried to reproduce the issue. Could you please confirm if that test NettyCatsRequestTimeoutTest shows your scenario?
changed the title [-][BUG] Do not parse interrupted request[/-][+][BUG] Server should return 400 Bad request if not all body bytes received[/+]on Apr 22, 2025
Activity
adamw commentedon Nov 18, 2024
Yeah this sounds like a bug, I suppose it should call
.onErrorwith a timeout exception?Would you be able to create a PR maybe?
sergiuszkierat commentedon Dec 19, 2024
@akozich I've prepared a draft #4214 where I've tried to reproduce the issue. Could you please confirm if that test
NettyCatsRequestTimeoutTestshows your scenario?[-][BUG] Do not parse interrupted request[/-][+][BUG] Server should return 400 Bad request if not all body bytes received[/+]rwalerow commentedon Aug 14, 2026
I did prepare a draft #5466 to check 400 Bad Request response
Netty: respond with 408 when the request timeout fires before the bod…
Fix passing incomplete body to parsers on connection abruptly closed (#…