From e26ee968952ce3155b84ef103a25885a744a64dc Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Thu, 20 Dec 2012 11:14:16 -0800 Subject: [PATCH] * FetchHTTPTests.java testLaxUrlEncoding() - Tests a URL not correctly url-encoded, but that heritrix should let pass through to mimic browser behavior (test fails currently) --- .../archive/modules/fetcher/FetchHTTPTests.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/src/test/java/org/archive/modules/fetcher/FetchHTTPTests.java b/modules/src/test/java/org/archive/modules/fetcher/FetchHTTPTests.java index 3b2f7368..270fd0ca 100644 --- a/modules/src/test/java/org/archive/modules/fetcher/FetchHTTPTests.java +++ b/modules/src/test/java/org/archive/modules/fetcher/FetchHTTPTests.java @@ -771,6 +771,21 @@ public class FetchHTTPTests extends ProcessorTestBase { noResponseServer.join(); } + /** + * Tests a URL not correctly url-encoded, but that heritrix lets pass + * through to mimic browser behavior. {@link java.net.URI} would reject this + * url. See class comment on {@link UURI}. + * + * @throws Exception + */ + public void testLaxUrlEncoding() throws Exception { + CrawlURI curi = makeCrawlURI("http://localhost:7777/99%"); + fetcher().process(curi); + // logger.info('\n' + httpRequestString(curi) + "\n\n" + rawResponseString(curi)); + assertTrue(httpRequestString(curi).startsWith("GET /99% HTTP/1.0\r\n")); + runDefaultChecks(curi, "requestLine"); + } + @Override protected FetchHTTP makeModule() throws IOException { FetchHTTP fetchHttp = newTestFetchHttp(getUserAgentString());