mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-21 22:19:07 -04:00
Fix (#5875)
Co-authored-by: ptrstr <ptrstr@protonmail.com> Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
parent
71965e6b69
commit
dcff640248
1 changed files with 12 additions and 0 deletions
|
@ -91,6 +91,18 @@ module.exports.generalSocketHandler = (socket, server) => {
|
|||
});
|
||||
|
||||
socket.on("getPushExample", (language, callback) => {
|
||||
try {
|
||||
checkLogin(socket);
|
||||
if (!/^[a-z-]+$/.test(language)) {
|
||||
throw new Error("Invalid language");
|
||||
}
|
||||
} catch (e) {
|
||||
callback({
|
||||
ok: false,
|
||||
msg: e.message,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
let dir = path.join("./extra/push-examples", language);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue