[OLINGO-1238]Handle all header values in Accept and Accept-Charset for batch calls

This commit is contained in:
ramya vasanth 2020-10-09 10:21:22 +05:30
parent c62513795e
commit eff9b984a5
1 changed files with 7 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.apache.olingo.commons.api.format.AcceptCharset;
import org.apache.olingo.commons.api.format.AcceptType;
@ -92,8 +93,12 @@ public final class ContentNegotiator {
throws ContentNegotiatorException {
final List<ContentType> supportedContentTypes =
getSupportedContentTypes(customContentTypeSupport, representationType);
final String acceptHeaderValue = request.getHeader(HttpHeader.ACCEPT);
String acceptCharset = request.getHeader(HttpHeader.ACCEPT_CHARSET);
final List<String> acceptHeaderValueList = request.getHeaders(HttpHeader.ACCEPT);
final String acceptHeaderValue = acceptHeaderValueList != null ?
acceptHeaderValueList.stream().collect(Collectors.joining(", ")) : null;
List<String> acceptCharsetValueList = request.getHeaders(HttpHeader.ACCEPT_CHARSET);
String acceptCharset = acceptCharsetValueList != null ?
acceptCharsetValueList.stream().collect(Collectors.joining(", ")) : null;
List<AcceptCharset> charsets = null;
ContentType result = null;