Merge pull request #3920 from overleaf/as-fix-unsupported-middleware

Fix unsupported browser middleware

GitOrigin-RevId: 27dc8cef4747abba85a985c28865340bc5116ab7
This commit is contained in:
Timothée Alby
2021-04-20 02:10:05 +00:00
committed by Copybot
parent 5520553e34
commit 97f89f132c
3 changed files with 69 additions and 0 deletions
@@ -6,6 +6,8 @@ function unsupportedBrowserMiddleware(req, res, next) {
const userAgent = req.headers['user-agent']
if (!userAgent) return next()
const parser = Bowser.getParser(userAgent)
// Allow bots through by only ignoring bots or unrecognised UA strings