summaryrefslogtreecommitdiff
path: root/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java
diff options
context:
space:
mode:
authorThomas <>2021-06-18 08:18:59 +0200
committerThomas <>2021-06-18 08:18:59 +0200
commit108df5e1cc640070d1b03fb2dfd99306e661b8fe (patch)
tree3480ccccbf20011572f2dc3b3db743d9f12d1482 /eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java
parent5a2544a18d44eec63ace935b1869da9c67d73f6c (diff)
downloadEAAF-Components-108df5e1cc640070d1b03fb2dfd99306e661b8fe.tar.gz
EAAF-Components-108df5e1cc640070d1b03fb2dfd99306e661b8fe.tar.bz2
EAAF-Components-108df5e1cc640070d1b03fb2dfd99306e661b8fe.zip
update some log messages
Diffstat (limited to 'eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java')
-rw-r--r--eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java
index cc2a8430..2b6ddb96 100644
--- a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java
+++ b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java
@@ -16,6 +16,7 @@ import org.apache.http.ParseException;
import org.apache.http.StatusLine;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.entity.ContentType;
import org.apache.http.util.EntityUtils;
import org.jose4j.base64url.Base64Url;
import org.slf4j.Logger;
@@ -57,10 +58,13 @@ public class SL20HttpBindingUtils {
throw new SlCommandoParserException("SL20 response contains NO ContentType");
}
-
- if (!response.getEntity().getContentType().getValue().startsWith("application/json")) {
+
+ final ContentType contentType = ContentType.getOrDefault(response.getEntity());
+ if (!ContentType.APPLICATION_JSON.getMimeType().equals(contentType.getMimeType())) {
+ log.error("SL20 response with statuscode: {} has wrong http ContentType: {}",
+ response.getStatusLine(), contentType);
throw new SlCommandoParserException(
- "SL20 response with a wrong ContentType: " + response.getEntity().getContentType().getValue());
+ "SL20 response with a wrong http ContentType: " + contentType);
}
@@ -190,7 +194,7 @@ public class SL20HttpBindingUtils {
}
} else {
- throw new SlCommandoParserException("Can NOT find content in http response");
+ throw new SlCommandoParserException("Can NOT find any content in http response");
}