workaround for services.m.c 500 error on some GET requests
authorDan Mills <thunder@mozilla.com>
Wed, 12 Mar 2008 23:06:28 -0700
changeset 44369 3f6b00c8a04038a3fe9186f7950e62b89a703204
parent 44368 fb70ea388fd8c2fc7c6a18d4d1222b40613d82d2
child 44370 b9f5de372f78ded0ab081fc3908046954ad41083
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
workaround for services.m.c 500 error on some GET requests
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -336,16 +336,23 @@ WeaveSyncService.prototype = {
         this._log.debug("Successfully created user directory.  Re-attempting login.");
         this._dav.baseURL = serverURL + "user/" + this.userPath + "/";
         this._dav.login.async(this._dav, self.cb, this.username, this.password);
         success = yield;
         if (!success)
           throw "Created user directory, but login still failed.  Aborting.";
       }
 
+      // FIXME: remove this after services.m.c gets fixed to not
+      // return 500 from a GET when parent dirs don't exist
+      this._dav.MKCOL("private/", self.cb);
+      ret = yield;
+      if (!ret)
+        throw "Could not create private key directory";
+
       this._dav.GET("private/privkey", self.cb);
       let keyResp = yield;
       Utils.ensureStatus(keyResp.status,
                          "Could not get private key from server", [[200,300],404]);
 
       if (keyResp.status != 404) {
         this._cryptoId.key = keyResp.responseText;