mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-22 17:22:58 +01:00
🚑 Manually buid basic auth header to prevent encoding issue with password #32
This commit is contained in:
parent
b4fb25d3d4
commit
619aa80687
@ -212,8 +212,11 @@ class WebdavTools {
|
|||||||
let conf = this.getConf();
|
let conf = this.getConf();
|
||||||
let options = {
|
let options = {
|
||||||
body: stream,
|
body: stream,
|
||||||
username: this.username,
|
// username: this.username,
|
||||||
password: encodeURIComponent(this.password),
|
// password: encodeURIComponent(this.password),
|
||||||
|
headers: {
|
||||||
|
'Authorization': 'Basic ' + Buffer.from(this.username + ':' + this.password).toString('base64')
|
||||||
|
}
|
||||||
};
|
};
|
||||||
if (conf.ssl === "true") {
|
if (conf.ssl === "true") {
|
||||||
options["https"] = { rejectUnauthorized: conf.self_signed === "false" };
|
options["https"] = { rejectUnauthorized: conf.self_signed === "false" };
|
||||||
@ -308,8 +311,9 @@ class WebdavTools {
|
|||||||
let stream = fs.createWriteStream(tmpFile);
|
let stream = fs.createWriteStream(tmpFile);
|
||||||
let conf = this.getConf();
|
let conf = this.getConf();
|
||||||
let options = {
|
let options = {
|
||||||
username: this.username,
|
headers: {
|
||||||
password: encodeURIComponent(this.password),
|
'Authorization': 'Basic ' + Buffer.from(this.username + ':' + this.password).toString('base64')
|
||||||
|
}
|
||||||
};
|
};
|
||||||
if (conf.ssl === "true") {
|
if (conf.ssl === "true") {
|
||||||
options["https"] = { rejectUnauthorized: conf.self_signed === "false" };
|
options["https"] = { rejectUnauthorized: conf.self_signed === "false" };
|
||||||
|
Loading…
Reference in New Issue
Block a user