[OLINGO-1238]Handle all header values in Accept and Accept-Charset for batch calls
This commit is contained in:
parent
c62513795e
commit
eff9b984a5
|
@ -24,6 +24,7 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Pattern;
|
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.AcceptCharset;
|
||||||
import org.apache.olingo.commons.api.format.AcceptType;
|
import org.apache.olingo.commons.api.format.AcceptType;
|
||||||
|
@ -92,8 +93,12 @@ public final class ContentNegotiator {
|
||||||
throws ContentNegotiatorException {
|
throws ContentNegotiatorException {
|
||||||
final List<ContentType> supportedContentTypes =
|
final List<ContentType> supportedContentTypes =
|
||||||
getSupportedContentTypes(customContentTypeSupport, representationType);
|
getSupportedContentTypes(customContentTypeSupport, representationType);
|
||||||
final String acceptHeaderValue = request.getHeader(HttpHeader.ACCEPT);
|
final List<String> acceptHeaderValueList = request.getHeaders(HttpHeader.ACCEPT);
|
||||||
String acceptCharset = request.getHeader(HttpHeader.ACCEPT_CHARSET);
|
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;
|
List<AcceptCharset> charsets = null;
|
||||||
|
|
||||||
ContentType result = null;
|
ContentType result = null;
|
||||||
|
|
Loading…
Reference in New Issue