From f28109c5aad447f394f7d3c935aa90766d869a6a Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Wed, 23 Oct 2013 11:44:37 +0200 Subject: [PATCH] Handle more cases of HTTP redirect --- enabler/src/de/schildbach/pte/util/ParserUtils.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/enabler/src/de/schildbach/pte/util/ParserUtils.java b/enabler/src/de/schildbach/pte/util/ParserUtils.java index b1a9e4dc..ce5cfa90 100644 --- a/enabler/src/de/schildbach/pte/util/ParserUtils.java +++ b/enabler/src/de/schildbach/pte/util/ParserUtils.java @@ -202,6 +202,10 @@ public final class ParserUtils { throw new NotFoundException(url); } + else if (responseCode == HttpURLConnection.HTTP_MOVED_PERM || responseCode == HttpURLConnection.HTTP_MOVED_TEMP) + { + throw new UnexpectedRedirectException(url, connection.getURL()); + } else { final String message = "got response: " + responseCode + " " + connection.getResponseMessage(); @@ -357,6 +361,10 @@ public final class ParserUtils { throw new NotFoundException(url); } + else if (responseCode == HttpURLConnection.HTTP_MOVED_PERM || responseCode == HttpURLConnection.HTTP_MOVED_TEMP) + { + throw new UnexpectedRedirectException(url, connection.getURL()); + } else { final String message = "got response: " + responseCode + " " + connection.getResponseMessage();