aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs.server/src
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2016-05-19 14:50:12 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2016-05-19 15:01:05 +0200
commitc54ff8bf123835e1e9592fcef799bafce9423a94 (patch)
tree3b40d1413a855b7ee61231bbe1feb3399da645b5 /org.eclipse.jgit.lfs.server/src
parentbf15a72ea050f5c7f2244f48e1c3e56a266a8da7 (diff)
downloadjgit-c54ff8bf123835e1e9592fcef799bafce9423a94.tar.gz
jgit-c54ff8bf123835e1e9592fcef799bafce9423a94.zip
[findBugs] Fix calculation of host header in SignerV4
We ignored the returned concatenation of host name and port number. Fix this and use a StringBuilder to avoid creation of unnecessary String objects. Change-Id: I61fac639d4a4c95412eb41a0f9131d0c38aca794 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.lfs.server/src')
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
index 08bb4b96fd..f95b605c85 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
@@ -229,12 +229,12 @@ class SignerV4 {
private static void addHostHeader(URL url,
Map<String, String> headers) {
- String hostHeader = url.getHost();
+ StringBuilder hostHeader = new StringBuilder(url.getHost());
int port = url.getPort();
if (port > -1) {
- hostHeader.concat(":" + Integer.toString(port)); //$NON-NLS-1$
+ hostHeader.append(":").append(port); //$NON-NLS-1$
}
- headers.put("Host", hostHeader); //$NON-NLS-1$
+ headers.put("Host", hostHeader.toString()); //$NON-NLS-1$
}
private static String canonicalizeHeaderNames(