mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-10-04 14:39:19 +08:00
feature: Add an option to enable Telegram to work behind a proxy. (#6125)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
@@ -96,12 +96,13 @@ class Bark extends NotificationProvider {
|
||||
*/
|
||||
async postNotification(notification, title, subtitle, endpoint) {
|
||||
let result;
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
if (notification.apiVersion === "v1" || notification.apiVersion == null) {
|
||||
// url encode title and subtitle
|
||||
title = encodeURIComponent(title);
|
||||
subtitle = encodeURIComponent(subtitle);
|
||||
const params = this.additionalParameters(notification);
|
||||
result = await axios.get(`${endpoint}/${title}/${subtitle}${params}`);
|
||||
result = await axios.get(`${endpoint}/${title}/${subtitle}${params}`, config);
|
||||
} else {
|
||||
result = await axios.post(`${endpoint}/push`, {
|
||||
title,
|
||||
@@ -109,7 +110,7 @@ class Bark extends NotificationProvider {
|
||||
icon: barkNotificationAvatar,
|
||||
sound: notification.barkSound || "telegraph", // default sound is telegraph
|
||||
group: notification.barkGroup || "UptimeKuma", // default group is UptimeKuma
|
||||
});
|
||||
}, config);
|
||||
}
|
||||
this.checkResult(result);
|
||||
if (result.statusText != null) {
|
||||
|
Reference in New Issue
Block a user