Skip to content

Commit ebc8895

Browse files
committed
In UrlKey make hostname case insensitive
1 parent f690fbd commit ebc8895

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/src/main/java/net/sourceforge/jnlp/util/UrlKey.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class UrlKey {
1717
public UrlKey(final URL url) {
1818
this.url = url;
1919
this.protocol = url.getProtocol() != null ? url.getProtocol().toLowerCase(Locale.ENGLISH) : null;
20-
this.host = url.getHost();
20+
this.host = url.getHost() != null ? url.getHost().toLowerCase(Locale.ENGLISH) : null;
2121
this.port = url.getPort();
2222
this.file = url.getFile();
2323
this.ref = url.getRef();

core/src/test/java/net/sourceforge/jnlp/util/UrlKeyTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public void testEqualsHttp() throws Exception {
1313
URL url1 = new URL("http://www.example.com:80/index.html?a=b#3");
1414
List<URL> urlList = Arrays.asList(
1515
new URL("http://www.example.com/index.html?a=b#3"),
16+
new URL("http://www.Example.Com/index.html?a=b#3"),
1617
new URL("Http://www.example.com/index.html?a=b#3"),
1718
new URL("http://www.example.com:80/index.html?a=b#3"));
1819

@@ -29,7 +30,7 @@ public void testEqualsHttp() throws Exception {
2930
public void testNotEqualsHttp() throws Exception {
3031
URL url1 = new URL("http://www.example.com:80/index.html?a=b#3");
3132
List<URL> urlList = Arrays.asList(
32-
new URL("http://www.Example.com:80/index.html?a=b#3"),
33+
new URL("http://www.example.org:80/index.html?a=b#3"),
3334
new URL("http://www.example.com:80/index2.html?a=b#3"),
3435
new URL("http://www.example.com:80/index.html#3"),
3536
new URL("https://www.example.com:80/index.html?a=b#3"),

0 commit comments

Comments
 (0)