Skip to content

Commit 5be8b08

Browse files
committed
Test for redirects in form of ./file.html
No repro on jhy#585
1 parent e6514a0 commit 5be8b08

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/test/java/org/jsoup/integration/UrlConnectTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,19 @@ public void followsRedirectToHttps() throws IOException {
177177

178178
@Test
179179
public void followsRelativeRedirect() throws IOException {
180-
Connection con = Jsoup.connect("http://direct.infohound.net/tools/302-rel.pl"); // to ./ - /tools/
180+
Connection con = Jsoup.connect("http://direct.infohound.net/tools/302-rel.pl"); // to /tidy/
181181
Document doc = con.post();
182182
assertTrue(doc.title().contains("HTML Tidy Online"));
183183
}
184184

185+
@Test
186+
public void followsRelativeDotRedirect() throws IOException {
187+
// redirects to "./ok.html", should resolve to http://direct.infohound.net/tools/ok.html
188+
Connection con = Jsoup.connect("http://direct.infohound.net/tools/302-rel-dot.pl"); // to ./ok.html
189+
Document doc = con.post();
190+
assertTrue(doc.title().contains("OK"));
191+
}
192+
185193
@Test
186194
public void followsRedirectsWithWithespaces() throws IOException {
187195
Connection con = Jsoup.connect("http://tinyurl.com/kgofxl8"); // to http://www.google.com/?q=white spaces

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy