Bug 1394601 - Log an error when the Google API key is missing during Safe Browsing initialization. r?gcp draft
authorFrancois Marier <francois@mozilla.com>
Mon, 28 Aug 2017 17:06:00 -0700
changeset 654580 f4f42f7b8940026b5531cc6fd075f27ace81631f
parent 654398 3529b653ede26f990eb7320649015294ad0f8e76
child 728594 0d5141c72eef24eef83934a7df24fc73025239f0
push id76607
push userfmarier@mozilla.com
push dateTue, 29 Aug 2017 00:16:44 +0000
reviewersgcp
bugs1394601
milestone57.0a1
Bug 1394601 - Log an error when the Google API key is missing during Safe Browsing initialization. r?gcp MozReview-Commit-ID: DNwa9lR0J6K
toolkit/components/url-classifier/SafeBrowsing.jsm
--- a/toolkit/components/url-classifier/SafeBrowsing.jsm
+++ b/toolkit/components/url-classifier/SafeBrowsing.jsm
@@ -300,16 +300,17 @@ this.SafeBrowsing = {
         "browser.safebrowsing.provider." + provider + ".gethashURL");
       updateURL = updateURL.replace("SAFEBROWSING_ID", clientID);
       gethashURL = gethashURL.replace("SAFEBROWSING_ID", clientID);
 
       // Disable updates and gethash if the Google API key is missing.
       let googleKey = Services.urlFormatter.formatURL("%GOOGLE_API_KEY%").trim();
       if ((provider == "google" || provider == "google4") &&
           (!googleKey || googleKey == "no-google-api-key")) {
+        log("Missing Google API key, clearing updateURL and gethashURL.");
         updateURL = "";
         gethashURL = "";
       }
 
       log("Provider: " + provider + " updateURL=" + updateURL);
       log("Provider: " + provider + " gethashURL=" + gethashURL);
 
       // Urls used to update DB