Compare case-insensitive

This commit is contained in:
Martin Fietz 2015-12-04 13:17:35 +01:00
parent 1559660609
commit 5600080229
1 changed files with 2 additions and 2 deletions

View File

@ -75,14 +75,14 @@ public class AntennapodHttpClient {
if(location.startsWith("/")) { // URL is not absolute, but relative
URL url = request.url();
location = url.getProtocol() + "://" + url.getHost() + location;
} else if(!location.startsWith("http://") && !location.startsWith("https://")) {
} else if(!location.toLowerCase().startsWith("http://") &&
!location.toLowerCase().startsWith("https://")) {
// Reference is relative to current path
URL url = request.url();
String path = url.getPath();
String newPath = path.substring(0, path.lastIndexOf("/") + 1) + location;
location = url.getProtocol() + "://" + url.getHost() + newPath;
}
Log.d(TAG, "New location: " + location);
try {
DBWriter.updateFeedDownloadURL(request.urlString(), location).get();
} catch (Exception e) {