jersey
  1. jersey
  2. JERSEY-2062

SSE Client - MessageBodyReader not found using Content-Type = text/event-stream;charset=utf-8

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.3
    • Component/s: media
    • Labels:
      None

      Description

      Current implementation check MediaType equality and fails because additional parameters may be present:
      InboundEventReader#isReadable
      (https://github.com/jersey/jersey/blob/master/media/sse/src/main/java/org/glassfish/jersey/media/sse/InboundEventReader.java#L82)

      Looks like it could be replaced with MediaType#isCompatible in order to accept "text/event-stream; charset=utf-8"

      New editor draft (http://dev.w3.org/html5/eventsource/
      12 August 2013) warns about legacy servers sending additional parameters

      IANA considerations
      11.1 text/event-stream
      Optional parameters:
      charset
      The charset parameter may be provided. The parameter's value must be "utf-8". This parameter serves no purpose; it is only allowed for compatibility with legacy servers.

      Although the standard is clear about the mandatory use of UTF-8 (so not required to specify the charset) it is feasible to find servers returing it:

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Marek Potociar
            Reporter:
            apuig
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: