# HG changeset patch
# User t_mrc-ct@users.sourceforge.jp
# Date 1435666542 -32400
#      Tue Jun 30 21:15:42 2015 +0900
# Branch THUNDERBIRD3880_2016050308_RELBRANCH
# Node ID 6791e503f10caebcec359639db7549800051fbff
# Parent  f669b4165269074d9374ce26fa2128f2f0950dd5
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
@@ -3764,17 +3764,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);
     }
 
@@ -3808,37 +3808,46 @@
    */
   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");
       }
+*/
 
       recordInHealthReport(UpdaterHealthReportFields.CHECK_SUCCESS, 0);
 
       // 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. " +
