From 94707c08eaa4fc2f31c912420021e968665b5d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Alby?= Date: Mon, 4 Nov 2019 16:50:34 +0700 Subject: [PATCH] Merge pull request #2291 from overleaf/ta-events-validate Validate Events with Regex GitOrigin-RevId: f0a57345862ce4daefaa9f01b851d446230ed46d --- services/web/app/src/Features/Analytics/AnalyticsRouter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/web/app/src/Features/Analytics/AnalyticsRouter.js b/services/web/app/src/Features/Analytics/AnalyticsRouter.js index d24e95e1b2..06d2f5361a 100644 --- a/services/web/app/src/Features/Analytics/AnalyticsRouter.js +++ b/services/web/app/src/Features/Analytics/AnalyticsRouter.js @@ -4,7 +4,10 @@ const AnalyticsProxy = require('./AnalyticsProxy') module.exports = { apply(webRouter, privateApiRouter, publicApiRouter) { - webRouter.post('/event/:event', AnalyticsController.recordEvent) + webRouter.post( + '/event/:event([a-z0-9-_]+)', + AnalyticsController.recordEvent + ) webRouter.put( '/editingSession/:projectId',