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:
parent
5f1e582b05
commit
683af21691
2 changed files with 4 additions and 4 deletions
|
@ -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 += "/";
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue