Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java

Issue 29411633: Issue 5136 - Add test for AndroidWebRequestResourceWrapper (Closed)
Patch Set: Created April 13, 2017, 1:40 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
index 93611101a97382b42a3dc8f75e682bc741c5a103..79c5a8692c40a6fda04d6e9c7d88b7034c846ec2 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
@@ -136,4 +136,14 @@ public final class Utils
}
}
}
+
+ public static String getUrlWithoutParams(String urlWithParams)
+ {
+ if (urlWithParams == null) {
+ throw new IllegalArgumentException("URL can't be null");
+ }
+
+ int pos = urlWithParams.indexOf("?");
+ return (pos >= 0 ? urlWithParams.substring(0, pos) : urlWithParams);
+ }
}

Powered by Google App Engine
This is Rietveld