|
|
@ -372,9 +372,11 @@ class ImageHelper {
|
|
|
|
if (++redirects > MAX_REDIRECTS)
|
|
|
|
if (++redirects > MAX_REDIRECTS)
|
|
|
|
throw new IOException("Too many redirects");
|
|
|
|
throw new IOException("Too many redirects");
|
|
|
|
|
|
|
|
|
|
|
|
String location = URLDecoder.decode(
|
|
|
|
String header = urlConnection.getHeaderField("Location");
|
|
|
|
urlConnection.getHeaderField("Location"),
|
|
|
|
if (header == null)
|
|
|
|
StandardCharsets.UTF_8.name());
|
|
|
|
throw new IOException("Location header missing");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String location = URLDecoder.decode(header, StandardCharsets.UTF_8.name());
|
|
|
|
url = new URL(url, location);
|
|
|
|
url = new URL(url, location);
|
|
|
|
Log.i("Redirect #" + redirects + " to " + url);
|
|
|
|
Log.i("Redirect #" + redirects + " to " + url);
|
|
|
|
|
|
|
|
|
|
|
|