Loading app/src/main/java/app/fedilab/android/mastodon/helper/Helper.java +6 −2 Original line number Diff line number Diff line Loading @@ -1848,7 +1848,6 @@ public class Helper { if (responseCode == HttpURLConnection.HTTP_OK) { String fileName = ""; String disposition = httpURLConnection.getHeaderField("Content-Disposition"); if (disposition != null) { // extracts file name from header field int index = disposition.indexOf("filename="); Loading @@ -1858,8 +1857,13 @@ public class Helper { } } else { // extracts file name from URL try { URL downLoadUrlTmp = new URL(downloadUrl); fileName = downLoadUrlTmp.getPath().replace("/","_"); }catch (Exception exception) { fileName = downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1); } } fileName = FileNameCleaner.cleanFileName(fileName); // opens input stream from the HTTP connection InputStream inputStream = httpURLConnection.getInputStream(); Loading Loading
app/src/main/java/app/fedilab/android/mastodon/helper/Helper.java +6 −2 Original line number Diff line number Diff line Loading @@ -1848,7 +1848,6 @@ public class Helper { if (responseCode == HttpURLConnection.HTTP_OK) { String fileName = ""; String disposition = httpURLConnection.getHeaderField("Content-Disposition"); if (disposition != null) { // extracts file name from header field int index = disposition.indexOf("filename="); Loading @@ -1858,8 +1857,13 @@ public class Helper { } } else { // extracts file name from URL try { URL downLoadUrlTmp = new URL(downloadUrl); fileName = downLoadUrlTmp.getPath().replace("/","_"); }catch (Exception exception) { fileName = downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1); } } fileName = FileNameCleaner.cleanFileName(fileName); // opens input stream from the HTTP connection InputStream inputStream = httpURLConnection.getInputStream(); Loading