Skip to content

Node.js based forum software built for the modern web

fix: add HEAD check to unsub route

Barış Soner Uşaklı205bf4778343
diff --git a/src/controllers/accounts/settings.js b/src/controllers/accounts/settings.js
index 8530486d7c..1c16bf49c2 100644
--- a/src/controllers/accounts/settings.js
+++ b/src/controllers/accounts/settings.js
@@ -126,6 +126,9 @@ const doUnsubscribe = async (payload) => {
};
settingsController.unsubscribe = async (req, res) => {
+ if (req.method === 'HEAD') {
+ return res.sendStatus(204);
+ }
try {
const payload = await jwtVerifyAsync(req.params.token);
if (!payload || !unsubscribable.includes(payload.template)) {