Fix file sync errors with passwords containing % + two hex digits

Usernames and passwords going into nsIURI have to be percent-encoded.
This commit is contained in:
Dan Stillman 2013-12-04 02:17:11 -05:00
parent 5f1e582b05
commit 683af21691
2 changed files with 4 additions and 4 deletions

View file

@ -815,8 +815,8 @@ Zotero.Sync.Storage.WebDAV = (function () {
var ios = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
var uri = ios.newURI(url, null, null);
uri.username = username;
uri.password = password;
uri.username = encodeURIComponent(username);
uri.password = encodeURIComponent(password);
if (!uri.spec.match(/\/$/)) {
uri.spec += "/";
}

View file

@ -684,8 +684,8 @@ Zotero.Sync.Storage.ZFS = (function () {
var ios = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
var uri = ios.newURI(url, null, null);
uri.username = username;
uri.password = password;
uri.username = encodeURIComponent(username);
uri.password = encodeURIComponent(password);
_rootURI = uri;
uri = uri.clone();