Mercurial > hg > release > icedtea-web-1.5
changeset 963:79a3a7a01760
Allowed wrong match of the aaaexample.com by *.example.com expression as in specification.
author | Jiri Vanek <jvanek@redhat.com> |
---|---|
date | Mon, 31 Mar 2014 19:20:19 +0200 |
parents | ee80e215928e |
children | dc0a77856cb4 |
files | ChangeLog netx/net/sourceforge/jnlp/util/ClasspathMatcher.java tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java |
diffstat | 3 files changed, 20 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Mar 31 16:54:52 2014 +0200 +++ b/ChangeLog Mon Mar 31 19:20:19 2014 +0200 @@ -1,3 +1,12 @@ +2013-03-31 Jiri Vanek <jvanek@redhat.com> + + Allowed wrong match of the aaaexample.com by *.example.com expression as in + specification. + * netx/net/sourceforge/jnlp/util/ClasspathMatcher.java: uncommented handling + of dot in (domainToRegEx). + * tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java: + (matchTest) uncommented and added tests of/for dot issue. + 2013-03-31 Jiri Vanek <jvanek@redhat.com> Alexandr Kolouch <skolnag@gmail.com>
--- a/netx/net/sourceforge/jnlp/util/ClasspathMatcher.java Mon Mar 31 16:54:52 2014 +0200 +++ b/netx/net/sourceforge/jnlp/util/ClasspathMatcher.java Mon Mar 31 19:20:19 2014 +0200 @@ -146,10 +146,11 @@ } private static Pattern domainToRegEx(String domain) { - // I have conisdered the "dot" as bug i specification - // while (domain.startsWith("*.")) { - // domain = "*" + domain.substring(2); - //} + // Although I have conisdered the "dot" as bug in specification, + // to many applications are depnding on it + while (domain.startsWith("*.")) { + domain = "*" + domain.substring(2); + } return ClasspathMatcher.sourceToRegEx(domain); } }
--- a/tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java Mon Mar 31 16:54:52 2014 +0200 +++ b/tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java Mon Mar 31 19:20:19 2014 +0200 @@ -422,9 +422,13 @@ Assert.assertTrue(p.match(urls[13])); Assert.assertTrue(p.match(urls[14])); //those represent the "dot" issue - //Assert.assertTrue(p.match(urls[15])); - //Assert.assertTrue(p.match(urls[16])); + Assert.assertTrue(p.match(urls[15])); + Assert.assertTrue(p.match(urls[16])); Assert.assertFalse(p.match(urls[17])); + //reasons for alowing "dot" issue + Assert.assertTrue(p.match(new URL("http://www.example.com"))); + Assert.assertTrue(p.match(new URL("http://example.com"))); //yah, this is really nasty + //still the DOT issue is an BUG } @Test