summaryrefslogtreecommitdiff
path: root/eaaf_modules/eaaf_module_auth_sl20
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
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')
-rw-r--r--eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java3
-rw-r--r--eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java12
2 files changed, 9 insertions, 6 deletions
diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java
index 0d0f990a..84ad06e7 100644
--- a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java
+++ b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java
@@ -81,8 +81,7 @@ public abstract class AbstractReceiveQualEidTask extends AbstractAuthServletTask
sl20ReqObj = new JsonMapper().getMapper().readTree(Base64Url.decodeToUtf8String(sl20Result));
} catch (final JsonParseException e) {
- log.warn("SL2.0 command or result is NOT valid JSON.", e);
- log.debug("SL2.0 msg: " + sl20Result);
+ log.error("SL2.0 command or result is NOT valid JSON. Received msg: {}", sl20Result, e);
throw new SL20Exception("sl20.02", new Object[] { "SL2.0 command or result is NOT valid JSON." },
e);
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");
}