[
https://issues.apache.org/jira/browse/CXF-7462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16111917#comment-16111917
]
ASF GitHub Bot commented on CXF-7462:
-------------------------------------
Github user reta commented on a diff in the pull request:
https://github.com/apache/cxf/pull/301#discussion_r131022992
--- Diff:
rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/OutboundSseEventImpl.java ---
@@ -41,7 +41,7 @@
private long reconnectDelay = -1;
private Class<?> type;
private Type genericType;
- private MediaType mediaType;
+ private MediaType mediaType = MediaType.SERVER_SENT_EVENTS_TYPE;
--- End diff --
I would agree with @sberyozkin, `mediaType = MediaType.TEXT_PLAIN_TYPE`
would be the safest option, but definitely not
`MediaType.SERVER_SENT_EVENTS_TYPE`
> OutboundSseEventImpl could use some minor tweaks
> ------------------------------------------------
>
> Key: CXF-7462
> URL: https://issues.apache.org/jira/browse/CXF-7462
> Project: CXF
> Issue Type: Improvement
> Components: JAX-RS
> Affects Versions: 3.2.0
> Reporter: Andy McCright
> Priority: Minor
> Fix For: 3.2.0
>
>
> The OutboundSseEventImpl class could use some minor tweaks, including:
> 1) Make the fields final to reflect that the event is immutable.
> 2) Use defaults for the data type (String.class) and media type
> (SERVER_SENT_EVENT_TYPE).
> 3) Restrict the constructor's visibility.
> I also plan to add some tests for these changes.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)