Merge pull request #6215 from overleaf/ae-logger-req-params

[logger] Handle undefined req.params

GitOrigin-RevId: cd435d906517034f78fdccc051625cbb537617d4
This commit is contained in:
Eric Mc Sween 2022-02-16 08:03:21 -05:00 committed by Copybot
parent 4dc4286d1b
commit 3864b5831e
3 changed files with 19 additions and 13 deletions

View file

@ -1,3 +1,7 @@
## v3.1.1
* Handle malformed requests in the req serializer
## v3.0.0
* Improve logging in Google Cloud Platform. Set environment variable `GCP_LOGGING=true` to enable.

View file

@ -7,7 +7,7 @@
"url": "https://github.com/overleaf/overleaf"
},
"license": "AGPL-3.0-only",
"version": "3.1.0",
"version": "3.1.1",
"scripts": {
"test": "mocha --grep=$MOCHA_GREP test/**/*.js",
"format": "prettier --list-different $PWD/'**/*.js'",

View file

@ -29,6 +29,7 @@ function reqSerializer(req) {
'content-length': headers['content-length'],
},
}
if (req.params) {
const projectId =
req.params.projectId || req.params.project_id || req.params.Project_id
const userId = req.params.userId || req.params.user_id
@ -42,6 +43,7 @@ function reqSerializer(req) {
if (docId) {
entry.docId = docId
}
}
return entry
}