Skip to content

Commit

Permalink
Merge pull request #519 from rfcx/bug/fix-request-log-error
Browse files Browse the repository at this point in the history
Fix request log error
  • Loading branch information
rassokhin-s authored Dec 22, 2023
2 parents 0f92146 + 883f551 commit 031ce41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.3.5 (2023-12-xx)
### Bug Fixes
* **core**: Fix Arbimon API path to separated the path between staging as `legacy-api` and production as `api`
* **core**: Fix logging request error on endpoint `streams/:id/detections` receiving array of objects

## 1.3.4 (2023-12-xx)
### Bug Fixes
* **core**: Fix PATCH `/users/:email` endpoint to properly update the name on Auth0 and core database
Expand Down
5 changes: 4 additions & 1 deletion common/middleware/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ module.exports = expressWinston.logger({
),
meta: false,
msg: function (req, res) {
let body = { ...req.body }
// stream/:id/detections receive request data as array
// classifier receive request data as object
// we don't want to spread array values into single object
let body = Array.isArray(req.body) ? req.body : { ...req.body }
// shorten long detections body request
if (/streams\/([a-zA-Z]|\d)+\/detections/.test(req.url) && req.body.length > 5) {
const totalLength = body.length
Expand Down

0 comments on commit 031ce41

Please sign in to comment.