Skip to content

Commit

Permalink
In UrlKey make hostname case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
janakmulani committed Dec 14, 2023
1 parent f690fbd commit ebc8895
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/net/sourceforge/jnlp/util/UrlKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class UrlKey {
public UrlKey(final URL url) {
this.url = url;
this.protocol = url.getProtocol() != null ? url.getProtocol().toLowerCase(Locale.ENGLISH) : null;
this.host = url.getHost();
this.host = url.getHost() != null ? url.getHost().toLowerCase(Locale.ENGLISH) : null;
this.port = url.getPort();
this.file = url.getFile();
this.ref = url.getRef();
Expand Down
3 changes: 2 additions & 1 deletion core/src/test/java/net/sourceforge/jnlp/util/UrlKeyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public void testEqualsHttp() throws Exception {
URL url1 = new URL("http://www.example.com:80/index.html?a=b#3");
List<URL> urlList = Arrays.asList(
new URL("http://www.example.com/index.html?a=b#3"),
new URL("http://www.Example.Com/index.html?a=b#3"),
new URL("Http://www.example.com/index.html?a=b#3"),
new URL("http://www.example.com:80/index.html?a=b#3"));

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

0 comments on commit ebc8895

Please sign in to comment.