aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src
diff options
context:
space:
mode:
authorChristian Maierhofer <cmaierhofer@iaik.tugraz.at>2016-01-08 10:22:09 +0100
committerChristian Maierhofer <cmaierhofer@iaik.tugraz.at>2016-01-08 10:22:09 +0100
commit08a6508c5f010ff1e7c924f2153386f32b77fa5a (patch)
tree1f6b000f504b85f561b0bf2b962c211efdfaa806 /pdf-as-web/src
parentddf15f29a6c641110f48b761b1e1ea51df5063a4 (diff)
downloadpdf-as-4-08a6508c5f010ff1e7c924f2153386f32b77fa5a.tar.gz
pdf-as-4-08a6508c5f010ff1e7c924f2153386f32b77fa5a.tar.bz2
pdf-as-4-08a6508c5f010ff1e7c924f2153386f32b77fa5a.zip
default ports for http and https in ProvidePDFServlet
Diffstat (limited to 'pdf-as-web/src')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java
index 6ff6ccf7..815d532e 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java
@@ -101,10 +101,15 @@ public class ProvidePDFServlet extends HttpServlet {
String template = PdfAsHelper.getInvokeRedirectTemplateSL();
URL url = new URL(invokeURL);
+ int p=url.getPort();
+ //no port, but http or https --> use default port
+ if((url.getProtocol().equalsIgnoreCase("https") || url.getProtocol().equalsIgnoreCase("http")) && p == -1){
+ p=url.getDefaultPort();
+ }
String invokeUrlProcessed = url.getProtocol() + "://" + // "http" + "://
url.getHost() + // "myhost"
":" + // ":"
- url.getPort() + // "8080"
+ p + // "8080"
url.getPath();
template = template.replace("##INVOKE_URL##", invokeUrlProcessed);