# HG changeset patch
# User t_mrc-ct@users.sourceforge.jp
# Date 1384608890 -32400
# Branch GECKO3110_2014082819_RELBRANCH
# Node ID 48514ad2ec4c154bd2fd3e8c818010e7d49aeb48
# Parent  984114ed2a74b44f1621104f3a02aea3c5458124
fix test failue: test_0082_prompt_unsupportAlreadyNotified.js

diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -3675,17 +3675,17 @@
         continue;
       }
       update.serviceURL = this.getUpdateURL(this._forced);
       // 104bird's <update/> doesn't contain <patch/> and it's OK.
       // But some test requires removing of such <update/>.
       // If testing situation detected (update.serviceURL begins with "http://localhost"),
       // don't append <patch/>-less <update/>.
       if (update.patchCount == 0 && update.serviceURL != null &&
-          update.serviceURL.search(/^https?:\/\/localhost(:[0-9]+)\//) == 0) {
+          update.serviceURL.search(/^https?:\/\/localhost(:[0-9]+)?\//) == 0) {
         LOG("Checker:updates get - <update/> without patch, ignoring...");
         continue;
       }
 
       update.channel = UpdateChannel.get();
       updates.push(update);
     }
 
@@ -3719,37 +3719,37 @@
    */
   onLoad: function UC_onLoad(event) {
     LOG("Checker:onLoad - request completed downloading document");
 
     var prefs = Services.prefs;
     var certs = null;
     if (!prefs.prefHasUserValue(PREF_APP_UPDATE_URL_OVERRIDE) &&
         getPref("getBoolPref", PREF_APP_UPDATE_CERT_CHECKATTRS, true)) {
+
+      if (this.getUpdateURL(this._forced).substr(0,7) != "http://") {
       certs = gCertUtils.readCertPrefs(PREF_APP_UPDATE_CERTS_BRANCH);
+      } else {
+      LOG("Checker:onLoad - warning, skipping cert check when http");
+      }
     }
 
     try {
       // Analyze the resulting DOM and determine the set of updates.
       var updates = this._updates;
       LOG("Checker:onLoad - number of updates available: " + updates.length);
-
-      if (this.getUpdateURL(this._forced).substr(0,7) != "http://") {
       var allowNonBuiltIn = !getPref("getBoolPref",
                                      PREF_APP_UPDATE_CERT_REQUIREBUILTIN, true);
       gCertUtils.checkCert(this._request.channel, allowNonBuiltIn, certs);
 
       if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_CERT_ERRORS))
         Services.prefs.clearUserPref(PREF_APP_UPDATE_CERT_ERRORS);
 
       if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_BACKGROUNDERRORS))
         Services.prefs.clearUserPref(PREF_APP_UPDATE_BACKGROUNDERRORS);
-      } else {
-      LOG("Checker:onLoad - warning, skipping cert check when http");
-      }
 
       // Tell the callback about the updates
       this._callback.onCheckComplete(event.target, updates, updates.length);
     }
     catch (e) {
       LOG("Checker:onLoad - there was a problem checking for updates. " +
           "Exception: " + e);
       var request = event.target;
