imbajin commented on code in PR #115:
URL:
https://github.com/apache/incubator-hugegraph-commons/pull/115#discussion_r1013981234
##########
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java:
##########
@@ -412,15 +412,14 @@ private Pair<Builder, Entity<?>> buildRequest(
/**
* parse user custom content-type, returns MediaType.APPLICATION_JSON_TYPE
default.
- * @param headers
- * @return
+ * @param headers custom http header
*/
- public static MediaType parseCustomContentType(MultivaluedMap<String,
Object> headers) {
+ private static MediaType parseCustomContentType(MultivaluedMap<String,
Object> headers) {
String customContentType = null;
if (MapUtils.isNotEmpty(headers) && headers.get("Content-Type") !=
null) {
- Object contentTypeObj = headers.get("Content-Type");
- if (contentTypeObj instanceof List) {
- customContentType = ((List<?>)
contentTypeObj).get(0).toString();
+ List<?> contentTypeObj = headers.get("Content-Type");
+ if (contentTypeObj != null && !contentTypeObj.isEmpty()) {
+ customContentType = contentTypeObj.get(0).toString();
Review Comment:
address the #113 here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]