Skip to content

Commit

Permalink
Use empty string in Sse event when there is no data
Browse files Browse the repository at this point in the history
Using an empty string instead of null
is what the classic rest client does,
so let's align with it

Closes: quarkusio#37033
  • Loading branch information
geoand committed Nov 13, 2023
1 parent 7ebe3dc commit c09e40f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private void dispatchEvent() {
event.setComment(commentBuffer.length() == 0 ? null : commentBuffer.toString());
// SSE spec says empty string is the default, but JAX-RS says null if not specified
event.setId(lastEventId);
event.setData(dataBuffer.length() == 0 ? null : dataBuffer.toString());
event.setData(dataBuffer.length() == 0 ? "" : dataBuffer.toString());
// SSE spec says "message" is the default, but JAX-RS says null if not specified
event.setName(eventType);
event.setReconnectDelay(eventReconnectTime);
Expand Down

0 comments on commit c09e40f

Please sign in to comment.