Skip to content

Commit a848712

Browse files
committed
Includes a copy of in
https://publicsuffix.org/list/effective_tld_names.dat in httpclient5/src/test/resources/org/publicsuffix/list/effective_tld_names.dat
1 parent fc1bae5 commit a848712

File tree

5 files changed

+15820
-5
lines changed

5 files changed

+15820
-5
lines changed

NOTICE.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ Copyright 1999-2023 The Apache Software Foundation
44
This product includes software developed at
55
The Apache Software Foundation (http://www.apache.org/).
66

7+
This product includes a copy of in https://publicsuffix.org/list/effective_tld_names.dat
8+
in httpclient5/src/test/resources/org/publicsuffix/list/effective_tld_names.dat
9+
This Source Code Form is subject to the terms of the Mozilla Public
10+
License, v. 2.0. If a copy of the MPL was not distributed with this
11+
file, You can obtain one at https://mozilla.org/MPL/2.0/.

httpclient5/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
</goals>
124124
<configuration>
125125
<url>https://publicsuffix.org/list/effective_tld_names.dat</url>
126-
<outputDirectory>${project.build.outputDirectory}/mozilla</outputDirectory>
126+
<outputDirectory>${project.build.outputDirectory}/src/test/resources/org/publicsuffix/list</outputDirectory>
127127
<outputFileName>public-suffix-list.txt</outputFileName>
128128
</configuration>
129129
</execution>

httpclient5/src/test/java/org/apache/hc/client5/http/psl/TestPublicSuffixMatcher.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@
4040
class TestPublicSuffixMatcher {
4141

4242
private static final String SOURCE_FILE = "suffixlistmatcher.txt";
43-
private static final String PUBLIC_SUFFIX_LIST_FILE = "mozilla/public-suffix-list.txt";
43+
private static final String PUBLIC_SUFFIX_LIST_FILE = "org/publicsuffix/list/effective_tld_names.dat";
4444

4545
private PublicSuffixMatcher matcher;
4646
private PublicSuffixMatcher pslMatcher;
4747

48+
/**
49+
* Create a matcher using the public suffix list file provided by Mozilla.
50+
*
51+
* This test a copy of in https://publicsuffix.org/list/effective_tld_names.dat in
52+
* httpclient5/src/test/resources/org/publicsuffix/list/effective_tld_names.dat
53+
*/
4854
@BeforeEach
4955
void setUp() throws Exception {
5056
final ClassLoader classLoader = getClass().getClassLoader();
@@ -54,9 +60,6 @@ void setUp() throws Exception {
5460
final List<PublicSuffixList> lists = PublicSuffixListParser.INSTANCE.parseByType(new InputStreamReader(in, StandardCharsets.UTF_8));
5561
matcher = new PublicSuffixMatcher(lists);
5662
}
57-
// Create a matcher using the public suffix list file provided by Mozilla
58-
// Note: the test requires `mvn generate-resources` to have been called to fetch the Mozilla file into
59-
// target/classes so that it is on the classpath
6063
final URL publicSuffixListUrl = classLoader.getResource(PUBLIC_SUFFIX_LIST_FILE);
6164
pslMatcher = PublicSuffixMatcherLoader.load(publicSuffixListUrl);
6265
}

0 commit comments

Comments
 (0)