Merge pull request #4301 from ByteHamster/double-scheme
Accept more malformed subscribtion URIs
This commit is contained in:
commit
2339b2b8d4
|
@ -56,6 +56,13 @@ public class URLCheckerTest {
|
|||
assertEquals("http://example.com", out);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testItpcProtocolWithScheme() {
|
||||
final String in = "itpc://https://example.com";
|
||||
final String out = URLChecker.prepareURL(in);
|
||||
assertEquals("https://example.com", out);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWhiteSpaceUrlShouldNotAppend() {
|
||||
final String in = "\n http://example.com \t";
|
||||
|
|
|
@ -41,7 +41,7 @@ public final class URLChecker {
|
|||
String lowerCaseUrl = url.toLowerCase(); // protocol names are case insensitive
|
||||
if (lowerCaseUrl.startsWith("feed://")) {
|
||||
if (BuildConfig.DEBUG) Log.d(TAG, "Replacing feed:// with http://");
|
||||
return url.replaceFirst("feed://", "http://");
|
||||
return prepareURL(url.substring("feed://".length()));
|
||||
} else if (lowerCaseUrl.startsWith("pcast://")) {
|
||||
if (BuildConfig.DEBUG) Log.d(TAG, "Removing pcast://");
|
||||
return prepareURL(url.substring("pcast://".length()));
|
||||
|
@ -50,7 +50,7 @@ public final class URLChecker {
|
|||
return prepareURL(url.substring("pcast:".length()));
|
||||
} else if (lowerCaseUrl.startsWith("itpc")) {
|
||||
if (BuildConfig.DEBUG) Log.d(TAG, "Replacing itpc:// with http://");
|
||||
return url.replaceFirst("itpc://", "http://");
|
||||
return prepareURL(url.substring("itpc://".length()));
|
||||
} else if (lowerCaseUrl.startsWith(AP_SUBSCRIBE)) {
|
||||
if (BuildConfig.DEBUG) Log.d(TAG, "Removing antennapod-subscribe://");
|
||||
return prepareURL(url.substring(AP_SUBSCRIBE.length()));
|
||||
|
|
Loading…
Reference in New Issue