allow redirect if staying on same host

This commit is contained in:
Andreas Schildbach 2012-09-18 11:47:59 +02:00
parent ae4d78cbbc
commit 6ac291eb5f

View file

@ -119,7 +119,7 @@ public final class ParserUtils
{
final String contentType = connection.getContentType();
final String contentEncoding = connection.getContentEncoding();
if (!url.equals(connection.getURL()))
if (!url.getHost().equals(connection.getURL().getHost()))
throw new UnexpectedRedirectException(url, connection.getURL());
final InputStream is;
@ -270,7 +270,7 @@ public final class ParserUtils
final String contentType = connection.getContentType();
final String contentEncoding = connection.getContentEncoding();
final InputStream is = connection.getInputStream();
if (!url.equals(connection.getURL()))
if (!url.getHost().equals(connection.getURL().getHost()))
throw new UnexpectedRedirectException(url, connection.getURL());
if (sessionCookieName != null)