Introduced in: #4390 (which addressed #3433)
Cookie paths can be null. This is not handled in HeaderUtils.java:326, which causes a NullPointerException to be thrown.
return first.getPath().length() > second.getPath().length() ? first : second;
The problem occurs when the client receives something like the following, where it did not in versions prior to #4390 being implemented.
public static void main (String[] args) {
var a = new NewCookie("NAME", "VALUE");
var b = new NewCookie("NAME", "VALUE");
try {
HeaderUtils.getPreferredCookie(a, b);
} catch (NullPointerException e) {
e.printStackTrace();
}
}