Skip to content

Commit 4623213

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

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,10 @@ static boolean isUrlOpenAllowed(@NonNull String url, @NonNull String[] allowedPr
283283
if (url.startsWith("https")) {
284284
return true;
285285
}
286-
287-
for (String protocol : allowedProtocols) {
288-
if (url.startsWith(protocol)) {
286+
287+
String urlProtocol = url.split("://")[0];
288+
for (String allowedProtocol : allowedProtocols) {
289+
if (urlProtocol.equals(allowedProtocol)) {
289290
return true;
290291
}
291292
}

0 commit comments

Comments
 (0)