Skip to content

Commit

Permalink
🚑 UrlEncore of password to prevent URI malformed error, Possible fix …
Browse files Browse the repository at this point in the history
…for #32
  • Loading branch information
Sebclem committed Nov 17, 2020
1 parent 830f8d6 commit a0ff15d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ class WebdavTools {
let options = {
body: stream,
username: this.username,
password: this.password,
password: encodeURI(this.password),
};
if (conf.ssl === "true") {
options["https"] = { rejectUnauthorized: conf.self_signed === "false" };
}
logger.debug(`...URI: ${this.baseUrl + encodeURI(path)} rejectUnauthorized: ${options["https"]["rejectUnauthorized"]}`);
logger.debug(`...URI: ${encodeURI(this.baseUrl + path)} rejectUnauthorized: ${options["https"]["rejectUnauthorized"]}`);

got.stream
.put(this.baseUrl + encodeURI(path), options)
.put(encodeURI(this.baseUrl + path), options)
.on("uploadProgress", (e) => {
let percent = e.percent;
if (status.progress != percent) {
Expand Down Expand Up @@ -311,9 +311,9 @@ class WebdavTools {
if (conf.ssl === "true") {
options["https"] = { rejectUnauthorized: conf.self_signed === "false" };
}
logger.debug(`...URI: ${this.baseUrl + encodeURI(path)} rejectUnauthorized: ${options["https"]["rejectUnauthorized"]}`)
logger.debug(`...URI: ${encodeURI(this.baseUrl + path)} rejectUnauthorized: ${options["https"]["rejectUnauthorized"]}`);
pipeline(
got.stream.get(this.baseUrl + encodeURI(path), options).on("downloadProgress", (e) => {
got.stream.get(encodeURI(this.baseUrl + path), options).on("downloadProgress", (e) => {
let percent = Math.round(e.percent * 100) / 100;
if (status.progress != percent) {
status.progress = percent;
Expand Down

0 comments on commit a0ff15d

Please sign in to comment.