softwaremill / softwaremill/tapir
[BUG] Server should return 400 Bad request if not all body bytes received
@rwalerow is already working on this.
Since Aug 10, 2026.
- Dominant language
- Scala
- Stars
- 1.5k
- Forks
- 468
- Avg merge
- 5h 37m
- Merged PRs (30d)
- 34
Description
Tapir version: 1.11.7
Scala version: 3.5.0
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.