We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a53a90c commit 7e1c374Copy full SHA for 7e1c374
server/server.ts
@@ -15,6 +15,11 @@ app.use(bodyParser.urlencoded({ extended: true }))
15
16
app.use((req, res, next) => {
17
if (req.body && req.body.sessionId) {
18
+ if (req.body.sessionId.length > 300)
19
+ return res.status(403).send({
20
+ message: "SessionId length is too long",
21
+ code: Errors.SessionIdTooLong,
22
+ })
23
if (req.body.sessionId in sessionCounter) next()
24
else {
25
if (Object.keys(sessionCounter).length > 20)
src/errors.ts
@@ -4,4 +4,5 @@ export enum Errors {
4
InvalidCounterValue,
5
FailedTokenVerify,
6
MissingRequestToken,
7
+ SessionIdTooLong,
8
}
0 commit comments