Skip to content

Commit

Permalink
🚑 Manually buid basic auth header to prevent encoding issue with pass…
Browse files Browse the repository at this point in the history
…word #32
  • Loading branch information
Sebclem committed Nov 17, 2020
1 parent b4fb25d commit 619aa80
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,11 @@ class WebdavTools {
let conf = this.getConf();
let options = {
body: stream,
username: this.username,
password: encodeURIComponent(this.password),
// username: this.username,
// password: encodeURIComponent(this.password),
headers: {
'Authorization': 'Basic ' + Buffer.from(this.username + ':' + this.password).toString('base64')
}
};
if (conf.ssl === "true") {
options["https"] = { rejectUnauthorized: conf.self_signed === "false" };
Expand Down Expand Up @@ -308,8 +311,9 @@ class WebdavTools {
let stream = fs.createWriteStream(tmpFile);
let conf = this.getConf();
let options = {
username: this.username,
password: encodeURIComponent(this.password),
headers: {
'Authorization': 'Basic ' + Buffer.from(this.username + ':' + this.password).toString('base64')
}
};
if (conf.ssl === "true") {
options["https"] = { rejectUnauthorized: conf.self_signed === "false" };
Expand Down

0 comments on commit 619aa80

Please sign in to comment.