HTTPCLIENT-1904: check cookie domain for null

This commit is contained in:
Hans-Peter Keck 2018-02-09 10:21:59 +01:00 committed by Oleg Kalnichevski
parent 1253d7f411
commit a2cc0a511b

View File

@ -90,6 +90,9 @@ public PublicSuffixDomainFilter(
@Override @Override
public boolean match(final Cookie cookie, final CookieOrigin origin) { public boolean match(final Cookie cookie, final CookieOrigin origin) {
final String host = cookie.getDomain(); final String host = cookie.getDomain();
if (host == null) {
return false;
}
final int i = host.indexOf('.'); final int i = host.indexOf('.');
if (i >= 0) { if (i >= 0) {
final String domain = host.substring(i); final String domain = host.substring(i);