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

RequestImpl.selectVariant() using wrong headers

    XMLWordPrintableJSON

Details

    • Novice

    Description

      org.apache.cxf.jaxrs.impl.RequestImpl
      ******
      public Variant selectVariant(List<Variant> vars) throws IllegalArgumentException {
      if (vars == null || vars.isEmpty())

      { throw new IllegalArgumentException("List of Variants is either null or empty"); }

      MediaType inMediaType = headers.getMediaType();
      Locale inLang = headers.getLanguage();
      String inEnc = headers.getRequestHeaders().getFirst(HttpHeaders.CONTENT_ENCODING);
      .....
      }
      ******

      In order to select the correct variant (conneg), Accept-* headers should be used, therefore headers.getAcceptableMediaTypes(), headers.getAcceptableLanguages() and headers.getRequestHeaders().getFirst(ACCEPT_ENCODING) should be used instead of headers.getMediaType(), headers.getLanguage() and headers.getRequestHeaders().getFirst(HttpHeaders.CONTENT_ENCODING).

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            sharathp sharath p
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: