RFR: 8254049: Update WebView to public suffix list 2020-04-24 [v2]

Kevin Rushforth kcr at openjdk.java.net
Tue Nov 24 19:33:00 UTC 2020


On Tue, 17 Nov 2020 04:08:15 GMT, Arun Joseph <ajoseph at 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
>
> Arun Joseph has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Check whether PSL file exists

I tested it both with and without the `public_suffix_list.dat` file in the JDK. I left a few inline comments, but this is almost ready to go.

modules/javafx.web/src/main/java/com/sun/webkit/network/PublicSuffixes.java line 79:

> 77:             String javaHome = System.getProperty("java.home");
> 78:             String resourceName = "lib/security/public_suffix_list.dat";
> 79:             File f = new File(javaHome, resourceName);

I think it would be useful to log a warning here if the public suffix file does not exist (since this code is only executed once the warning would only be logged once).

modules/javafx.web/src/main/java/com/sun/webkit/network/PublicSuffixes.java line 191:

> 189:                 (PrivilegedAction<InputStream>) () -> {
> 190:                     String javaHome = System.getProperty("java.home");
> 191:                     String resourceName = "lib/security/public_suffix_list.dat";

Maybe have the path to the file in a static final field so you don't have to duplicate it in two places?

modules/javafx.web/src/main/java/com/sun/webkit/network/PublicSuffixes.java line 109:

> 107: 
> 108:         if (!pslFileExists())
> 109:             return false;

Please enclose this in curly braces per coding guidelines.

-------------

PR: https://git.openjdk.java.net/jfx/pull/324


More information about the openjfx-dev mailing list