mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-09-08 02:12:10 +00:00
fix btoa is not define
This commit is contained in:
parent
34d8984e3a
commit
3d222ac5f5
@ -87,8 +87,8 @@ class Monitor extends BeanModel {
|
|||||||
* for HTTP "basic" auth, as per RFC-7617
|
* for HTTP "basic" auth, as per RFC-7617
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
encodeB64(user, pass) {
|
encodeBase64(user, pass) {
|
||||||
return btoa(user + ":" + pass);
|
return Buffer.from(user + ":" + pass).toString("base64");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -156,7 +156,7 @@ class Monitor extends BeanModel {
|
|||||||
let basicAuthHeader = {};
|
let basicAuthHeader = {};
|
||||||
if (this.basic_auth_user) {
|
if (this.basic_auth_user) {
|
||||||
basicAuthHeader = {
|
basicAuthHeader = {
|
||||||
"Authorization": "Basic " + this.encodeB64(this.basic_auth_user, this.basic_auth_pass),
|
"Authorization": "Basic " + this.encodeBase64(this.basic_auth_user, this.basic_auth_pass),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user