Skip to content

Commit

Permalink
deps: body-parser@1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Feb 23, 2023
1 parent 506fbd6 commit 1e42a98
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
unreleased
==========

* deps: body-parser@1.20.2
- Fix strict json error message on Node.js 19+
- deps: content-type@~1.0.5
- deps: raw-body@2.5.2

4.18.2 / 2022-10-08
===================

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
"body-parser": "1.20.1",
"body-parser": "1.20.2",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
"cookie": "0.5.0",
Expand Down
8 changes: 4 additions & 4 deletions test/express.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ describe('express.json()', function () {
.post('/')
.set('Content-Type', 'application/json')
.send('true')
.expect(400, '[entity.parse.failed] ' + parseError('#rue').replace('#', 't'), done)
.expect(400, '[entity.parse.failed] ' + parseError('#rue').replace(/#/g, 't'), done)
})
})

Expand Down Expand Up @@ -290,15 +290,15 @@ describe('express.json()', function () {
.post('/')
.set('Content-Type', 'application/json')
.send('true')
.expect(400, '[entity.parse.failed] ' + parseError('#rue').replace('#', 't'), done)
.expect(400, '[entity.parse.failed] ' + parseError('#rue').replace(/#/g, 't'), done)
})

it('should not parse primitives with leading whitespaces', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'application/json')
.send(' true')
.expect(400, '[entity.parse.failed] ' + parseError(' #rue').replace('#', 't'), done)
.expect(400, '[entity.parse.failed] ' + parseError(' #rue').replace(/#/g, 't'), done)
})

it('should allow leading whitespaces in JSON', function (done) {
Expand All @@ -316,7 +316,7 @@ describe('express.json()', function () {
.set('X-Error-Property', 'stack')
.send('true')
.expect(400)
.expect(shouldContainInBody(parseError('#rue').replace('#', 't')))
.expect(shouldContainInBody(parseError('#rue').replace(/#/g, 't')))
.end(done)
})
})
Expand Down

0 comments on commit 1e42a98

Please sign in to comment.