cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sharath p (Created) (JIRA)" <>
Subject [jira] [Created] (CXF-4243) RequestImpl.selectVariant() using wrong headers
Date Tue, 17 Apr 2012 19:13:17 GMT
RequestImpl.selectVariant() using wrong headers

                 Key: CXF-4243
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 2.3.1
         Environment: cxf-rt-frontend-jaxrs-2.3.1
            Reporter: sharath p
            Priority: Minor

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).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message