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 <thomas.lenz@egiz.gv.at>2019-12-05 09:52:48 +0100
committerThomas <thomas.lenz@egiz.gv.at>2019-12-05 09:52:48 +0100
commit3fada6cef21c9b16467177d866df778203b51b4d (patch)
tree8fe8ed37b6ee9fe35a1e035ceba6c68808328415 /eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java
parent95b21a826e5d81fdeabcf4673a9e87047edaec9d (diff)
downloadEAAF-Components-3fada6cef21c9b16467177d866df778203b51b4d.tar.gz
EAAF-Components-3fada6cef21c9b16467177d866df778203b51b4d.tar.bz2
EAAF-Components-3fada6cef21c9b16467177d866df778203b51b4d.zip
some code code-style modifications
active code-quality checks!
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.java27
1 files changed, 14 insertions, 13 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 6a8b96d4..1d7c9646 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
@@ -3,15 +3,18 @@ package at.gv.egiz.eaaf.modules.auth.sl20.utils;
import java.io.IOException;
import java.io.StringWriter;
import java.net.URISyntaxException;
+
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
import org.apache.http.client.utils.URIBuilder;
import org.jose4j.base64url.Base64Url;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
+
import com.fasterxml.jackson.databind.JsonNode;
public class SL20HttpBindingUtils {
@@ -20,26 +23,24 @@ public class SL20HttpBindingUtils {
/**
* Write SL2.0 response into http-response object
*
- * @param httpReq Current http request
- * @param httpResp Current http response
- * @param sl20Forward SL2.0 command that should be written to response
- * @param redirectUrl SL2.0 redirect URL in case of SL2.0 redirect command and no native client
- * (see SL2.0 specification)
- * @param httpCodeRedirect http redirect-code in case of SL2.0 redirect command and no native
- * client (see SL2.0 specification)
- * @throws IOException In case of an IO error
+ * @param httpReq Current http request
+ * @param httpResp Current http response
+ * @param sl20Forward SL2.0 command that should be written to response
+ * @param redirectUrl SL2.0 redirect URL in case of SL2.0 redirect command
+ * and no native client (see SL2.0 specification)
+ * @param httpCodeRedirect http redirect-code in case of SL2.0 redirect command
+ * and no native client (see SL2.0 specification)
+ * @throws IOException In case of an IO error
* @throws URISyntaxException In case of a wrong URL
*/
public static void writeIntoResponse(@Nonnull final HttpServletRequest httpReq,
@Nonnull final HttpServletResponse httpResp, @Nonnull final JsonNode sl20Forward,
- @Nullable final String redirectUrl, @Nonnull final int httpCodeRedirect)
- throws IOException, URISyntaxException {
+ @Nullable final String redirectUrl, @Nonnull final int httpCodeRedirect) throws IOException, URISyntaxException {
// forward SL2.0 command
httpResp.addIntHeader(SL20Constants.HTTP_HEADER_SL20_RESP, SL20Constants.CURRENT_SL20_VERSION);
- if (httpReq.getHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE) != null
- && httpReq.getHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE)
- .equals(SL20Constants.HTTP_HEADER_VALUE_NATIVE)) {
+ if (httpReq.getHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE) != null && httpReq
+ .getHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE).equals(SL20Constants.HTTP_HEADER_VALUE_NATIVE)) {
log.debug("Client request containts 'native client' header ... ");
final StringWriter writer = new StringWriter();
writer.write(sl20Forward.toString());