Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ResponseSpec.bodyToMono subscribes twice in case of empty body [SPR-17653] #22182
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.