Skip to content

Commit ce2dcaf

Browse files
committed
Exact match urlProtocol with allowedProtocol
1 parent 0044686 commit ce2dcaf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableUtil.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ boolean writeFile(File file, String content) {
280280
}
281281

282282
static boolean isUrlOpenAllowed(@NonNull String url, @NonNull String[] allowedProtocols) {
283-
if (url.startsWith("https")) {
283+
String urlProtocol = url.split("://")[0];
284+
if(urlProtocol.equals("https")){
284285
return true;
285286
}
286-
287-
for (String protocol : allowedProtocols) {
288-
if (url.startsWith(protocol)) {
287+
for (String allowedProtocol : allowedProtocols) {
288+
if (urlProtocol.equals(allowedProtocol)) {
289289
return true;
290290
}
291291
}

0 commit comments

Comments
 (0)