Bug 1507223 - Show an error when full URL is used for permissions. r=Felipe a=lizzard
authorMichael Kaply <mozilla@kaply.com>
Mon, 19 Nov 2018 16:15:56 +0000
changeset 501405 ec33377dad653e3d1b0e4c49a26cf37f2663c168
parent 501404 7e6e1cdaaad3c10c45c35b6764fab2716f0f4840
child 501406 6fcd1d505c808bd7e14aaefecb9759cd7194bb87
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe, lizzard
bugs1507223
milestone64.0
Bug 1507223 - Show an error when full URL is used for permissions. r=Felipe a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D12181
toolkit/components/utils/JsonSchemaValidator.jsm
--- a/toolkit/components/utils/JsonSchemaValidator.jsm
+++ b/toolkit/components/utils/JsonSchemaValidator.jsm
@@ -192,16 +192,17 @@ function validateAndParseSimpleParam(par
       }
 
       try {
         parsedParam = new URL(param);
 
         let pathQueryRef = parsedParam.pathname + parsedParam.hash;
         // Make sure that "origin" types won't accept full URLs.
         if (pathQueryRef != "/" && pathQueryRef != "") {
+          log.error(`Ignoring parameter "${param}" - origin was expected but received full URL.`);
           valid = false;
         } else {
           valid = true;
         }
       } catch (ex) {
         valid = false;
       }
       break;