From da4e275eaddcef242b3912d85b3bbf35f713c80b Mon Sep 17 00:00:00 2001 From: Jonathan Hedley Date: Fri, 20 Oct 2023 12:31:43 +1100 Subject: [PATCH] Update some URL tests These only get manually executed. The unescaped redirect is tough to port to the Jetty test suite as it won't emit that invalid header. --- .../org/jsoup/integration/UrlConnectTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/jsoup/integration/UrlConnectTest.java b/src/test/java/org/jsoup/integration/UrlConnectTest.java index 1a25206b8e..cbc2bdb676 100644 --- a/src/test/java/org/jsoup/integration/UrlConnectTest.java +++ b/src/test/java/org/jsoup/integration/UrlConnectTest.java @@ -396,8 +396,8 @@ public void canSpecifyResponseCharset() throws IOException { public void handlesUnescapedRedirects() throws IOException { // URL locations should be url safe (ascii) but are often not, so we should try to guess // in this case the location header is utf-8, but defined in spec as iso8859, so detect, convert, encode - String url = "http://direct.infohound.net/tools/302-utf.pl"; - String urlEscaped = "http://direct.infohound.net/tools/test%F0%9F%92%A9.html"; + String url = "https://direct.infohound.net/tools/302-utf.pl"; + String urlEscaped = "https://direct.infohound.net/tools/test%F0%9F%92%A9.html"; Connection.Response res = Jsoup.connect(url).execute(); Document doc = res.parse(); @@ -410,17 +410,17 @@ public void handlesUnescapedRedirects() throws IOException { } @Test public void handlesEscapesInRedirecct() throws IOException { - Document doc = Jsoup.connect("http://infohound.net/tools/302-escaped.pl").get(); - assertEquals("http://infohound.net/tools/q.pl?q=one%20two", doc.location()); + Document doc = Jsoup.connect("https://direct.infohound.net/tools/302-escaped.pl").get(); + assertEquals("https://direct.infohound.net/tools/q.pl?q=one%20two", doc.location()); - doc = Jsoup.connect("http://infohound.net/tools/302-white.pl").get(); - assertEquals("http://infohound.net/tools/q.pl?q=one%20two", doc.location()); + doc = Jsoup.connect("https://direct.infohound.net/tools/302-white.pl").get(); + assertEquals("https://direct.infohound.net/tools/q.pl?q=one+two", doc.location()); } @Test public void handlesUt8fInUrl() throws IOException { - String url = "http://direct.infohound.net/tools/test\uD83D\uDCA9.html"; - String urlEscaped = "http://direct.infohound.net/tools/test%F0%9F%92%A9.html"; + String url = "https://direct.infohound.net/tools/test\uD83D\uDCA9.html"; + String urlEscaped = "https://direct.infohound.net/tools/test%F0%9F%92%A9.html"; Connection.Response res = Jsoup.connect(url).execute(); Document doc = res.parse();