You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2017/08/06 11:58:47 UTC

[2/7] wicket git commit: Fixes issue of pushing resources - review changes

Fixes issue of pushing resources - review changes

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

Branch: refs/heads/master
Commit: b16b075e49d3e72c02628ee6a15d8d993da6a1d1
Parents: 87c8f50
Author: Tobias Soloschenko <ts...@sapient.com>
Authored: Thu Aug 3 12:57:59 2017 +0200
Committer: Tobias Soloschenko <ts...@sapient.com>
Committed: Thu Aug 3 12:57:59 2017 +0200

----------------------------------------------------------------------
 .../apache/wicket/http2/markup/head/PushHeaderItem.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/b16b075e/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java
----------------------------------------------------------------------
diff --git a/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java b/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java
index 94d55ad..cb7aa44 100644
--- a/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java
+++ b/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java
@@ -368,21 +368,21 @@ public class PushHeaderItem extends HeaderItem
 
 				// The context path and the filter have to be applied to the URL, because otherwise
 				// the resource is not pushed correctly
-				StringBuffer partialUrl = new StringBuffer();
+				StringBuilder partialUrl = new StringBuilder();
 				String contextPath = WebApplication.get().getServletContext().getContextPath();
 				partialUrl.append(contextPath);
-				if (!contextPath.equals("/"))
+				if (!"/".equals(contextPath))
 				{
-					partialUrl.append("/");
+					partialUrl.append('/');
 				}
 				String filterPath = WebApplication.get().getWicketFilter().getFilterPath();
-				if (filterPath.equals("/"))
+				if ("/".equals(filterPath))
 				{
 					filterPath = "";
 				}
 				else if (filterPath.endsWith("/"))
 				{
-					filterPath = filterPath.replaceAll(".$", "");
+					filterPath = filterPath.substring(0, filterPath.length() - 1);
 				}
 				partialUrl.append(filterPath);
 				partialUrl.append(url.toString());