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 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions framework/src/org/apache/cordova/AllowListPlugin.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -93,23 +93,18 @@ public void handleStartTag(XmlPullParser xml) {
allowedIntents.addAllowListEntry(origin, false); allowedIntents.addAllowListEntry(origin, false);
} else if (strNode.equals("access")) { } else if (strNode.equals("access")) {
String origin = xml.getAttributeValue(null, "origin"); String origin = xml.getAttributeValue(null, "origin");
String subdomains = xml.getAttributeValue(null, "subdomains");
boolean external = (xml.getAttributeValue(null, "launch-external") != null);
if (origin != 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));
} else {
if ("*".equals(origin)) { if ("*".equals(origin)) {
allowedRequests.addAllowListEntry("http://*/*", false); allowedRequests.addAllowListEntry("http://*/*", false);
allowedRequests.addAllowListEntry("https://*/*", false); allowedRequests.addAllowListEntry("https://*/*", false);
} else { } else {
String subdomains = xml.getAttributeValue(null, "subdomains");
allowedRequests.addAllowListEntry(origin, (subdomains != null) && (subdomains.compareToIgnoreCase("true") == 0)); allowedRequests.addAllowListEntry(origin, (subdomains != null) && (subdomains.compareToIgnoreCase("true") == 0));
} }
} }
} }
} }
}


@Override @Override
public void handleEndTag(XmlPullParser xml) { } public void handleEndTag(XmlPullParser xml) { }
Expand Down

0 comments on commit 4fc48ff

Please sign in to comment.