Skip to content

Commit

Permalink
refactor: drop deprecated launch-external case for CustomConfigParser…
Browse files Browse the repository at this point in the history
…::handleStartTag
  • Loading branch information
erisu committed Dec 2, 2020
1 parent 52f00b0 commit 4fc48ff
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions framework/src/org/apache/cordova/AllowListPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,14 @@ public void handleStartTag(XmlPullParser xml) {
allowedIntents.addAllowListEntry(origin, false);
} else if (strNode.equals("access")) {
String origin = xml.getAttributeValue(null, "origin");
String subdomains = xml.getAttributeValue(null, "subdomains");
boolean external = (xml.getAttributeValue(null, "launch-external") != null);

if (origin != null) {
if (external) {
LOG.w(LOG_TAG, "Found <access launch-external> within config.xml. Please use <allow-intent> instead.");
allowedIntents.addAllowListEntry(origin, (subdomains != null) && (subdomains.compareToIgnoreCase("true") == 0));
if ("*".equals(origin)) {
allowedRequests.addAllowListEntry("http://*/*", false);
allowedRequests.addAllowListEntry("https://*/*", false);
} else {
if ("*".equals(origin)) {
allowedRequests.addAllowListEntry("http://*/*", false);
allowedRequests.addAllowListEntry("https://*/*", false);
} else {
allowedRequests.addAllowListEntry(origin, (subdomains != null) && (subdomains.compareToIgnoreCase("true") == 0));
}
String subdomains = xml.getAttributeValue(null, "subdomains");
allowedRequests.addAllowListEntry(origin, (subdomains != null) && (subdomains.compareToIgnoreCase("true") == 0));
}
}
}
Expand Down

0 comments on commit 4fc48ff

Please sign in to comment.