cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhigg...@apache.org
Subject webworks commit: CB-8941 Adds support for subdomain whitelisting
Date Wed, 22 Jul 2015 20:29:05 GMT
Repository: cordova-blackberry
Updated Branches:
  refs/heads/master 8b36c3188 -> 17da3f735


CB-8941 Adds support for subdomain whitelisting

Finds //*. in access origins and creates access objects with the base domain and subdomains
set true.

github: close #187


Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/17da3f73
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/17da3f73
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/17da3f73

Branch: refs/heads/master
Commit: 17da3f73583b60cac2d4f5689eeaba5c17697bf6
Parents: 8b36c31
Author: Tim Windsor <timothy.windsor@gmail.com>
Authored: Thu Jun 25 17:46:04 2015 -0400
Committer: Bryan Higgins <bryan@bryanhiggins.net>
Committed: Wed Jul 22 16:28:10 2015 -0400

----------------------------------------------------------------------
 bin/templates/project/cordova/lib/config-parser.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/17da3f73/bin/templates/project/cordova/lib/config-parser.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/lib/config-parser.js b/bin/templates/project/cordova/lib/config-parser.js
index 6887435..7cc4013 100644
--- a/bin/templates/project/cordova/lib/config-parser.js
+++ b/bin/templates/project/cordova/lib/config-parser.js
@@ -197,7 +197,11 @@ function processWidgetData(data, widgetConfig, session) {
                         throw localize.translate("EXCEPTION_FEATURE_DEFINED_WITH_WILDCARD_ACCESS_URI_OR_ORIGIN");
                     }
                     widgetConfig.hasMultiAccess = true;
-                } else {
+                } else if (originExist && attribs.origin.indexOf("//*.") > 0)
{
+                    // handle <access origin="http://*.google.com" /> CB-8941
+                    var baseOrigin = attribs.origin.replace("//*.", "//");
+                    widgetConfig.accessList.push(createAccessListObj(baseOrigin, true));
+                }else {
                     attribs.subdomains = packagerUtils.toBoolean(attribs.subdomains);
                     if (attribs.uri || attribs.origin) {
                         if (uriExist === true && originExist === true) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message