Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6104

Support case insensitive mime types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0.2
    • 3.0.3, 2.7.14, 3.1
    • JAX-RS
    • None
    • Novice

    Description

      A request with header

      Content-Type: application/json;charset=UTF-8

      will not match a method annotated with

      @Consumes("application/json; charset=utf-8")

      This is unfortunate since the former casing of "UTF-8" is used by several front-end frameworks, for instance Google's AngularJS (ngResource), and the latter casing is used several places by the Internet (w3.org for example).

      The "bug" is located here:

      org.apache.cxf.jaxrs.utils.JAXRSUtils#intersectMimeTypes(java.util.List<MediaType>, java.util.List<MediaType>, boolean, boolean)
                              if (value != null && !value.equals(entry.getValue())) {
      

      should be

                              if (value != null && !value.equalsIgnoreCase(entry.getValue())) {
      

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            jgogstad Jostein Gogstad
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: