summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorAndreas K├Ânig2012-12-13 11:43:59 (EST)
committer Chris Aniszczyk2013-03-27 10:44:13 (EDT)
commitd9d3439617677d75ffde57d2860807fa7c14aff0 (patch)
treef565f1cfdf53153282811409babb23d5db90823e
parent741ecf56b7eab161326806d566ef22c911496789 (diff)
downloadjgit-d9d3439617677d75ffde57d2860807fa7c14aff0.zip
jgit-d9d3439617677d75ffde57d2860807fa7c14aff0.tar.gz
jgit-d9d3439617677d75ffde57d2860807fa7c14aff0.tar.bz2
Fixed parsing of URI with a IPv6-addressrefs/changes/28/9228/2
Allowed ipv6-address in a uri like: http://[::1]:8080/repo.git Change-Id: Ia00a20f694b2e9314892df77f9b11f551bb1d34e Signed-off-by: Chris Aniszczyk <zx@twitter.com>
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
index b5a753b..2202a91 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
@@ -822,7 +822,7 @@ public class URIishTest {
String[] users = new String[] { "me", "l usr\\example.com",
"lusr\\example" };
String[] passes = new String[] { "wtf", };
- String[] hosts = new String[] { "example.com", "1.2.3.4" };
+ String[] hosts = new String[] { "example.com", "1.2.3.4", "[::1]" };
String[] ports = new String[] { "1234", "80" };
String[] paths = new String[] { "/", "/abc", "D:/x", "D:\\x" };
for (String[] test : tests) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
index 9befb92..d11edfc 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
@@ -87,7 +87,7 @@ public class URIish implements Serializable {
* Part of a pattern which matches the host part of URIs. Defines one
* capturing group containing the host name.
*/
- private static final String HOST_P = "([^\\\\/:]+)"; //$NON-NLS-1$
+ private static final String HOST_P = "((?:[^\\\\/:]+)|(?:\\[[0-9a-f:]+\\]))";
/**
* Part of a pattern which matches the optional port part of URIs. Defines