mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 09:29:49 +00:00
Handle more cases of HTTP redirect
This commit is contained in:
parent
3fa357d8ca
commit
f28109c5aa
1 changed files with 8 additions and 0 deletions
|
@ -202,6 +202,10 @@ public final class ParserUtils
|
||||||
{
|
{
|
||||||
throw new NotFoundException(url);
|
throw new NotFoundException(url);
|
||||||
}
|
}
|
||||||
|
else if (responseCode == HttpURLConnection.HTTP_MOVED_PERM || responseCode == HttpURLConnection.HTTP_MOVED_TEMP)
|
||||||
|
{
|
||||||
|
throw new UnexpectedRedirectException(url, connection.getURL());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final String message = "got response: " + responseCode + " " + connection.getResponseMessage();
|
final String message = "got response: " + responseCode + " " + connection.getResponseMessage();
|
||||||
|
@ -357,6 +361,10 @@ public final class ParserUtils
|
||||||
{
|
{
|
||||||
throw new NotFoundException(url);
|
throw new NotFoundException(url);
|
||||||
}
|
}
|
||||||
|
else if (responseCode == HttpURLConnection.HTTP_MOVED_PERM || responseCode == HttpURLConnection.HTTP_MOVED_TEMP)
|
||||||
|
{
|
||||||
|
throw new UnexpectedRedirectException(url, connection.getURL());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final String message = "got response: " + responseCode + " " + connection.getResponseMessage();
|
final String message = "got response: " + responseCode + " " + connection.getResponseMessage();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue