ResponseSpec.bodyToMono subscribes twice in case of empty body [SPR-17653] #22182
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: duplicate
A duplicate of another issue
Pavel Kryl opened SPR-17653 and commented
I think that I have just discovered a bug in spring web client. I am writing a reactive kotlin server, retrieving data from microservices, so I have a WebClient and when the response arrives, I am doing:
If the server response is empty however (without set Content-Length header), this fails with:
In such a wrong case (when body is expected, but none arrives) I would either presume a more readable exception/error signal or null emission or complete/empty signal. Any of these three options would be better than this IllegalStateException.
Please note, that the error does not occur if I parse to String::class.java.
Affects: 5.1.3
The text was updated successfully, but these errors were encountered: