fix: handle empty JSON responses in ResponseSubscribers

- Remove length check in hookOnComplete() to always emit AggregateResponseEvent
- Ensures proper completion handling regardless of response content length
- Add test for empty application/json responses with 200 OK status
This commit is contained in:
codezkk 2025-08-01 16:01:24 +08:00 • committed by Christian Tzolov
commit 5aba8a0e8f

View file

@ -238,10 +238,9 @@ class ResponseSubscribers {
@Override
protected void hookOnComplete() {
if (this.eventBuilder.length() > 0) {
String data = this.eventBuilder.toString();
this.sink.next(new AggregateResponseEvent(responseInfo, data));
}
String data = this.eventBuilder.toString();
this.sink.next(new AggregateResponseEvent(responseInfo, data));
this.sink.complete();
}