From 81c5ae84e538e5891df9fb828b173e5fb1b08f78 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:34:15 +0000 Subject: Include port in URLs git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@387 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../pdfover/gui/workflow/states/mobilebku/IAIKHandler.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'pdf-over-gui/src/main/java') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/IAIKHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/IAIKHandler.java index cd9f0939..2c00b3a9 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/IAIKHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/IAIKHandler.java @@ -62,7 +62,9 @@ public class IAIKHandler extends MobileBKUHandler { String credentialURL = MobileBKUHelper.extractTag(responseData, "name=\"userCredLogon\" method=\"post\" action=\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$ URL baseURL = new URL(status.getBaseURL()); - credentialURL = baseURL.getProtocol() + "://" + baseURL.getHost() + //$NON-NLS-1$ + int p = baseURL.getPort(); + String port = ((p != -1) && (p != baseURL.getDefaultPort())) ? ":" + p : ""; //$NON-NLS-1$ //$NON-NLS-2$ + credentialURL = baseURL.getProtocol() + "://" + baseURL.getHost() + port + //$NON-NLS-1$ (credentialURL.startsWith("/") ? "" : "/") + credentialURL; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ String viewState = MobileBKUHelper.extractTag(responseData, @@ -184,7 +186,9 @@ public class IAIKHandler extends MobileBKUHandler { redirectURL = MobileBKUHelper.extractTag(responseData, "redirect url=\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$ URL baseURL = new URL(status.getBaseURL()); - redirectURL = baseURL.getProtocol() + "://" + baseURL.getHost() + //$NON-NLS-1$ + int p = baseURL.getPort(); + String port = ((p != -1) && (p != baseURL.getDefaultPort())) ? ":" + p : ""; //$NON-NLS-1$ //$NON-NLS-2$ + redirectURL = baseURL.getProtocol() + "://" + baseURL.getHost() + port +//$NON-NLS-1$ (redirectURL.startsWith("/") ? "" : "/") + redirectURL; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ responseData = getRedirect(client, redirectURL); @@ -203,7 +207,9 @@ public class IAIKHandler extends MobileBKUHandler { String tanURL = MobileBKUHelper.extractTag(responseData, "name=\"j_idt6\" method=\"post\" action=\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$ URL baseURL = new URL(status.getBaseURL()); - tanURL = baseURL.getProtocol() + "://" + baseURL.getHost() + //$NON-NLS-1$ + int p = baseURL.getPort(); + String port = ((p != -1) && (p != baseURL.getDefaultPort())) ? ":" + p : ""; //$NON-NLS-1$ //$NON-NLS-2$ + tanURL = baseURL.getProtocol() + "://" + baseURL.getHost() + port + //$NON-NLS-1$ (tanURL.startsWith("/") ? "" : "/") + tanURL; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ tanURL = status.ensureSessionID(tanURL); -- cgit v1.2.3