Bug 1507223 - Show an error when full URL is used for permissions. r=Felipe
authorMichael Kaply <mozilla@kaply.com>
Mon, 19 Nov 2018 16:15:56 +0000
changeset 503447 b3787ede5d7baf7e6490758ec5898bd94cb9b123
parent 503446 e4658af66fdf23ad02f225a2f808bd346127c700
child 503448 1bd7fb2e62580ec67db80611659ca162293df0ba
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1507223
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507223 - Show an error when full URL is used for permissions. r=Felipe 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;