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

Improve media type parsing

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 12.0.0.Final
    • None
    • None
    • None

      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

              dberinde@redhat.com Dan Berindei (Inactive)
              dberinde@redhat.com Dan Berindei (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: