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

Chosen variant is not always the best match

XMLWordPrintable

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

      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

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

                Created:
                Updated:
                Resolved: