On Tue, 27 Oct 2020 00:38:31 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> We should use the public_suffix_list.dat file in the JDK instead. Reading >> the public_suffix_list.dat file is modified to be similar to >> [DomainName.java](https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/sun/security/util/DomainName.java). >> If the file is not present, `isPublicSuffix()` returns `false`, which is >> similar to how WebKit ignores the public suffix check when it is disabled. >> >> Test: Run PublicSuffixesTest.java > > modules/javafx.web/src/main/java/com/sun/webkit/network/PublicSuffixes.java > line 132: > >> 130: return null; >> 131: } >> 132: return rulesCache.computeIfAbsent(tld, k -> >> createRules(tld)); > > If the public_suffixes file cannot be loaded (for example, if it is removed > from the JDK), then this causes a warning to be logged on every call to this > (basically on every load of any web site). It might be better to call > `createRules` from a static init block. If `createRules` is called from a static init block, then all the public suffix rules (for all TLDs) must be loaded during initialization. Another approach would be to set a `fileNotFound` flag which could be set to true in `getPubSuffixStream` and call `Rules.getRules` only when the value is `false`. ------------- PR: https://git.openjdk.java.net/jfx/pull/324