Bug 1468069 - OAuth credentials overwritten r?Fallen draft
authorGeoff Lankow <geoff@darktrojan.net>
Sat, 23 Jun 2018 15:49:48 +1200
changeset 24863 798b587eed6884455f25f4b1349458ce581576fc
parent 24858 b59931d5608f56236b82636573aab27d8253d6e6
push id227
push userbmo:geoff@darktrojan.net
push dateSat, 23 Jun 2018 03:50:38 +0000
reviewersFallen
bugs1468069
Bug 1468069 - OAuth credentials overwritten r?Fallen MozReview-Commit-ID: Cz2iiZ3EyJ5
calendar/base/modules/utils/calAuthUtils.jsm
--- a/calendar/base/modules/utils/calAuthUtils.jsm
+++ b/calendar/base/modules/utils/calAuthUtils.jsm
@@ -218,17 +218,21 @@ var calauth = {
      * require it. This is a fallback for compatibility only and should be removed a few versions
      * after Lightning 6.2
      *
      * @param {String} aOrigin      The hostname or origin to check
      * @return {String}             The origin uri
      */
     _ensureOrigin: function(aOrigin) {
         try {
-            return Services.io.newURI(aOrigin).prePath;
+            let {prePath, spec} = Services.io.newURI(aOrigin);
+            if (prePath == "oauth:") {
+                return spec;
+            }
+            return prePath;
         } catch (e) {
             return "https://" + aOrigin;
         }
     },
 
     /**
      * Helper to insert/update an entry to the password manager.
      *