-
-
Save mxstbr/c9789493827e2558d1164ff3de9688f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.use('*', (req, res, next) => { | |
const query = req.query.query || req.body.query || ''; | |
if (query.length > 2000) { | |
throw new Error('Query too large'); | |
} | |
next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment