summaryrefslogtreecommitdiff
path: root/routes.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes.js')
-rwxr-xr-xroutes.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/routes.js b/routes.js
index cd81da5..e90360c 100755
--- a/routes.js
+++ b/routes.js
@@ -1309,6 +1309,11 @@ router.post('/unattendevent/:eventID', (req, res) => {
});
router.get('/oneclickunattendevent/:eventID/:attendeeID', (req, res) => {
+ // Mastodon will "click" links that sent to its users, presumably as a prefetch?
+ // Anyway, this ignores the automated clicks that are done without the user's knowledge
+ if (req.headers['user-agent'] && req.headers['user-agent'].includes('Mastodon')) {
+ return res.sendStatus(200);
+ }
Event.update(
{ id: req.params.eventID },
{ $pull: { attendees: { _id: req.params.attendeeID } } }