From a544e8f5508f4ce37178497da8f149142f38ffd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Tue, 10 Mar 2020 16:41:42 +0100 Subject: [PATCH] add backslash test --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- net-url/src/test/java/org/xbib/net/URLParserTest.java | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e3f2881..414de9d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ -#Wed Nov 06 21:26:30 CET 2019 -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-all.zip +#Tue Mar 10 16:34:18 CET 2020 +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/net-url/src/test/java/org/xbib/net/URLParserTest.java b/net-url/src/test/java/org/xbib/net/URLParserTest.java index d45dee0..6597142 100644 --- a/net-url/src/test/java/org/xbib/net/URLParserTest.java +++ b/net-url/src/test/java/org/xbib/net/URLParserTest.java @@ -139,6 +139,14 @@ class URLParserTest { assertEquals("http://foo.com/@", url.toExternalForm()); } + @Test + void testBackslashHost() { + URL url = URL.from("https://malicious.com\\google.com"); + assertEquals("malicious.com", url.getDecodedHost()); + assertEquals("/google.com", url.getPath()); + assertEquals("https://malicious.com/google.com", url.toExternalForm()); + } + @Test void testQuery() { URL url = URL.from("http://auth@foo.bar:1/path?query");