From bf154cf83dbf250f2f307cabaaec1e65c4bda724 Mon Sep 17 00:00:00 2001 From: Athou Date: Fri, 16 Aug 2013 21:23:11 +0200 Subject: [PATCH] set port too --- .../java/com/commafeed/frontend/CommaFeedApplication.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/commafeed/frontend/CommaFeedApplication.java b/src/main/java/com/commafeed/frontend/CommaFeedApplication.java index 890ba37f..c743b0a4 100644 --- a/src/main/java/com/commafeed/frontend/CommaFeedApplication.java +++ b/src/main/java/com/commafeed/frontend/CommaFeedApplication.java @@ -116,7 +116,13 @@ public class CommaFeedApplication extends AuthenticatedWebApplication { public String renderUrl(Url url) { String publicUrl = applicationSettingsService.get().getPublicUrl(); if (StringUtils.isNotBlank(publicUrl)) { - url.setProtocol(Url.parse(publicUrl).getProtocol()); + Url parsed = Url.parse(publicUrl); + + String protocol = parsed.getProtocol(); + url.setProtocol(protocol); + + Integer port = parsed.getPort(); + url.setPort(port != null ? port : StringUtils.equalsIgnoreCase(protocol, "http") ? 80 : 443); } return super.renderUrl(url); }