Skip to content

Commit

Permalink
Merge pull request #36450 from geoand/sse-null
Browse files Browse the repository at this point in the history
Don't emit null values from SSE
  • Loading branch information
geoand authored Oct 13, 2023
2 parents b2179b8 + d7911a1 commit 01240b9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ private <R> void registerForSse(MultiRequest<? super R> multiRequest,
sseSource.register(event -> {
// DO NOT pass the response mime type because it's SSE: let the event pick between the X-SSE-Content-Type header or
// the content-type SSE field
multiRequest.emit(event.readData(responseType));
R item = event.readData(responseType);
if (item != null) { // we don't emit null because it breaks Multi (by design)
multiRequest.emit(item);
}
}, multiRequest::fail, multiRequest::complete);
// watch for user cancelling
sseSource.registerAfterRequest(vertxResponse);
Expand Down

0 comments on commit 01240b9

Please sign in to comment.