Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12307

Improve media type parsing

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 12.0.0.Dev05
    • None
    • None
    • None

    Description

      Media type parsing has some problems with double-quoted parameters:

      • ; and , are interpreted as parameter/media type separator even when they occur in a quoted parameter value
      • ' is interpreted as a quoting character, the spec says only " must be used for quoting
      • Only spaces are allowed, not \t.
      • Spaces are allowed in too many places, e.g. type / subtype or parameter = value
      • Start and end quotes are removed from quoted parameter values, but the escaped characters inside are not unescaped.
      • Quotes are not added back in toString(), which makes deserialization fail if one of the parameters included an escaped double-quote (e.g. type/subtype; param="\"").

      Performance can also be improved, as we create many String instances via trim(), substring(), or split().

      The clearest explanation of the media type grammar seems to be in
      https://tools.ietf.org/html/rfc7231#section-3.1.1.1
      https://tools.ietf.org/html/rfc7230#section-3.2.6

      Attachments

        Activity

          People

            dberinde@redhat.com Dan Berindei (Inactive)
            dberinde@redhat.com Dan Berindei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: