Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-994

Chosen variant is not always the best match

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.0.7.Final
    • 2.3.6.Final, 3.0.6.Final
    • jaxrs
    • None

    Description

      Given the Accept header:

      Accept: application/json, */*
      

      And the set of variants:

      ["application/xml","application/json"]
      

      request.selectVariant(...) will choose application/xml. Assuming variant selection should follow the HTTP protocol behavior for the Accept header, this should not be the case:

      Media ranges can be overridden by more specific media ranges or specific media types. If more than one media range applies to a given type, the most specific reference has precedence. HTTP spec, section 14.1

      Attachments

        Activity

          People

            rsigal@redhat.com Ronald Sigal
            rh-ee-klape Kyle Lape
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: