URL Cleanup - polishing
See gh-22680
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -43,7 +43,7 @@ import com.gargoylesoftware.htmlunit.WebRequest;
|
||||
*
|
||||
* <pre class="code">WebRequestMatcher cdnMatcher = new HostMatcher("code.jquery.com:80");</pre>
|
||||
*
|
||||
* <p>The above {@code cdnMatcher} would match {@code "https://code.jquery.com/jquery.js"}
|
||||
* <p>The above {@code cdnMatcher} would match {@code "http://code.jquery.com/jquery.js"}
|
||||
* which has a default port of {@code 80} and {@code "http://code.jquery.com:80/jquery.js"}.
|
||||
* However, it would not match {@code "https://code.jquery.com/jquery.js"}
|
||||
* which has a default port of {@code 443}.
|
||||
|
||||
@@ -31,14 +31,14 @@ public class HostRequestMatcherTests extends AbstractWebRequestMatcherTests {
|
||||
public void localhost() throws Exception {
|
||||
WebRequestMatcher matcher = new HostRequestMatcher("localhost");
|
||||
assertMatches(matcher, "http://localhost/jquery-1.11.0.min.js");
|
||||
assertDoesNotMatch(matcher, "https://example.com/jquery-1.11.0.min.js");
|
||||
assertDoesNotMatch(matcher, "http://example.com/jquery-1.11.0.min.js");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void multipleHosts() throws Exception {
|
||||
WebRequestMatcher matcher = new HostRequestMatcher("localhost", "example.com");
|
||||
assertMatches(matcher, "http://localhost/jquery-1.11.0.min.js");
|
||||
assertMatches(matcher, "https://example.com/jquery-1.11.0.min.js");
|
||||
assertMatches(matcher, "http://example.com/jquery-1.11.0.min.js");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user