RequestImpl.selectVariant() using wrong headers -----------------------------------------------
Key: CXF-4243 URL: https://issues.apache.org/jira/browse/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 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). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira