🚑 Use encodeURIComponent for passwords

This commit is contained in:
Sebastien Clement 2020-11-17 22:40:12 +01:00
parent c4f5b00a84
commit cf93b87591

View File

@ -211,7 +211,7 @@ class WebdavTools {
let options = { let options = {
body: stream, body: stream,
username: this.username, username: this.username,
password: this.password, password: encodeURIComponent(this.password),
}; };
if (conf.ssl === "true") { if (conf.ssl === "true") {
options["https"] = { rejectUnauthorized: conf.self_signed === "false" }; options["https"] = { rejectUnauthorized: conf.self_signed === "false" };
@ -306,7 +306,7 @@ class WebdavTools {
let conf = this.getConf(); let conf = this.getConf();
let options = { let options = {
username: this.username, username: this.username,
password: encodeURI(this.password), password: encodeURIComponent(this.password),
}; };
if (conf.ssl === "true") { if (conf.ssl === "true") {
options["https"] = { rejectUnauthorized: conf.self_signed === "false" }; options["https"] = { rejectUnauthorized: conf.self_signed === "false" };