You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2012/10/19 12:39:05 UTC

git commit: WICKET-4824 set port explicitly, it won't be rendered by UrlRenderer if not required

Updated Branches:
  refs/heads/master 600f5dfb1 -> ad849602d


WICKET-4824 set port explicitly, it won't be rendered by UrlRenderer if not required


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/ad849602
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/ad849602
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/ad849602

Branch: refs/heads/master
Commit: ad849602d5dac53706da6f67175e3a22b7f3b418
Parents: 600f5df
Author: svenmeier <sv...@apache.org>
Authored: Fri Oct 19 12:33:35 2012 +0200
Committer: svenmeier <sv...@apache.org>
Committed: Fri Oct 19 12:33:35 2012 +0200

----------------------------------------------------------------------
 .../apache/wicket/protocol/https/HttpsMapper.java  |    5 +----
 .../wicket/protocol/https/HttpsMapperTest.java     |    6 ++++--
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/ad849602/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java b/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java
index a5f765a..aaa1a3e 100644
--- a/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java
+++ b/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java
@@ -170,10 +170,7 @@ public class HttpsMapper implements IRequestMapper
 			// the generated url does not have the correct scheme, set it (which in turn will cause
 			// the url to be rendered in its full representation)
 			url.setProtocol(desired.urlName());
-			if (url.getPort() != null || !desired.usesStandardPort(config))
-			{
-				url.setPort(desired.getPort(config));
-			}
+			url.setPort(desired.getPort(config));
 		}
 		return url;
 	}

http://git-wip-us.apache.org/repos/asf/wicket/blob/ad849602/wicket-core/src/test/java/org/apache/wicket/protocol/https/HttpsMapperTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/https/HttpsMapperTest.java b/wicket-core/src/test/java/org/apache/wicket/protocol/https/HttpsMapperTest.java
index 536015c..cc55338 100644
--- a/wicket-core/src/test/java/org/apache/wicket/protocol/https/HttpsMapperTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/protocol/https/HttpsMapperTest.java
@@ -28,13 +28,13 @@ import static org.mockito.Mockito.when;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.wicket.Page;
+import org.apache.wicket.core.request.handler.PageProvider;
+import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
 import org.apache.wicket.protocol.http.servlet.ServletWebRequest;
 import org.apache.wicket.protocol.https.HttpsMapper.RedirectHandler;
 import org.apache.wicket.request.IRequestHandler;
 import org.apache.wicket.request.IRequestMapper;
 import org.apache.wicket.request.Url;
-import org.apache.wicket.core.request.handler.PageProvider;
-import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
 import org.junit.Test;
 
 public class HttpsMapperTest
@@ -118,6 +118,7 @@ public class HttpsMapperTest
 		when(req.getScheme()).thenReturn("http");
 		mapper.mapHandler(handler, request);
 		assertThat(url.getProtocol(), is("https"));
+		assertThat(url.getPort(), is(443));
 
 		// render url to http page on http, ignore protocol
 		handler = new RenderPageRequestHandler(new PageProvider(InsecurePage.class));
@@ -136,6 +137,7 @@ public class HttpsMapperTest
 		when(req.getScheme()).thenReturn("https");
 		mapper.mapHandler(handler, request);
 		assertThat(url.getProtocol(), is("http"));
+		assertThat(url.getPort(), is(80));
 	}