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

Variant selection selects unacceptable variant

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.3.4.Final
    • 2.3.2.Final, 2.3.1
    • jaxrs
    • None

      If a request contains Accept-Language: *,de;q=0 (I accept any language except German) and the only language my resource has is German, then the variant selected by selectVariant is still German.

      List<Variant> variants = VariantListBuilder.newInstance().languages(Locale.GERMAN).build();
      request.selectVariant(variants) // <-- returns the German variant, should return null
      

      In fact, the documentation of selectVariant is vague enough to allow this behaviour, but it seems the implementation of org.jboss.resteasy.core.request.ServerDrivenNegotiation does try to return null if no variant is acceptable.

            patriot1burke@gmail.com Bill Burke (Inactive)
            clovis.seragiotto Clovis Seragiotto (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: