Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Includes a copy of publicsuffix.org's effective_tld_names.dat as a test fixture #574

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ Copyright 1999-2023 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

This product 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
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
9 changes: 7 additions & 2 deletions httpclient5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@
<include>**/*.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.dat</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
Expand All @@ -123,8 +129,7 @@
</goals>
<configuration>
<url>https://publicsuffix.org/list/effective_tld_names.dat</url>
<outputDirectory>${project.build.outputDirectory}/mozilla</outputDirectory>
ok2c marked this conversation as resolved.
Show resolved Hide resolved
<outputFileName>public-suffix-list.txt</outputFileName>
<outputDirectory>${project.basedir}/src/main/resources/org/publicsuffix/list</outputDirectory>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
@Contract(threading = ThreadingBehavior.SAFE)
public final class PublicSuffixMatcherLoader {

private static final String PUBLIC_SUFFIX_LIST = "org/publicsuffix/list/effective_tld_names.dat";

private static final Logger LOG = LoggerFactory.getLogger(PublicSuffixMatcherLoader.class);

private static final ReentrantLock lock = new ReentrantLock();
Expand Down Expand Up @@ -81,9 +83,8 @@ public static PublicSuffixMatcher getDefault() {
if (DEFAULT_INSTANCE == null) {
lock.lock();
try {
if (DEFAULT_INSTANCE == null){
final URL url = PublicSuffixMatcherLoader.class.getResource(
"/mozilla/public-suffix-list.txt");
if (DEFAULT_INSTANCE == null) {
final URL url = PublicSuffixMatcherLoader.class.getResource(PUBLIC_SUFFIX_LIST);
if (url != null) {
try {
DEFAULT_INSTANCE = load(url);
Expand Down
Loading