Skip to content

Commit 04674a6

Browse files
committed
fix: handle missing x-service-name header in Discord bot verification
1 parent 07f2e47 commit 04674a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

middlewares/authorizeBot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const verifyCronJob = async (req, res, next) => {
1818
const verifyDiscordBot = async (req, res, next) => {
1919
try {
2020
const token = req.headers.authorization.split(" ")[1];
21-
const serviceName = req.headers["x-service-name"];
21+
const serviceName = req.headers["x-service-name"] || "";
2222
if (serviceName === DISCORD_SERVICE) {
2323
const data = botVerifcation.verifyDiscordService(token);
2424
if (data.name !== DISCORD_SERVICE) {

0 commit comments

Comments
 (0)