Skip to content

Commit

Permalink
Merge tag '1.19.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Feb 19, 2022
2 parents fbd9664 + 424dadd commit d6be2b3
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 18 deletions.
49 changes: 37 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ jobs:

- name: Node.js 6.x
node-version: "6.17"
npm-i: mocha@6.2.2 nyc@14.1.1
npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.6

- name: Node.js 7.x
node-version: "7.10"
npm-i: mocha@6.2.2 nyc@14.1.1
npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.6

- name: Node.js 8.x
node-version: "8.17"
Expand All @@ -90,16 +90,16 @@ jobs:
node-version: "13.14"

- name: Node.js 14.x
node-version: "14.18"
node-version: "14.19"

- name: Node.js 15.x
node-version: "15.14"

- name: Node.js 16.x
node-version: "16.13"
node-version: "16.14"

- name: Node.js 17.x
node-version: "17.2"
node-version: "17.5"

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -146,6 +146,7 @@ jobs:
run: |
if npm -ps ls nyc | grep -q nyc; then
npm run test-ci
cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov"
else
npm test
fi
Expand All @@ -155,19 +156,43 @@ jobs:
run: npm run lint

- name: Collect code coverage
uses: coverallsapp/github-action@master
if: steps.list_env.outputs.nyc != ''
run: |
if [[ -d ./coverage ]]; then
mv ./coverage "./${{ matrix.name }}"
mkdir ./coverage
mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}"
fi
- name: Upload code coverage
uses: actions/upload-artifact@v2
if: steps.list_env.outputs.nyc != ''
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.test_number }}
parallel: true
name: coverage
path: ./coverage
retention-days: 1

coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Uploade code coverage
- uses: actions/checkout@v2

- name: Install lcov
shell: bash
run: sudo apt-get -y install lcov

- name: Collect coverage reports
uses: actions/download-artifact@v2
with:
name: coverage
path: ./coverage

- name: Merge coverage reports
shell: bash
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info

- name: Upload coverage report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
github-token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.x
===

This incorporates all changes after 1.19.1 up to 1.19.2.

2.0.0-beta.1 / 2021-12-17
=========================

Expand All @@ -6,6 +11,15 @@
* `urlencoded` parser now defaults `extended` to `false`
* Use `on-finished` to determine when body read

1.19.2 / 2022-02-15
===================

* deps: bytes@3.1.2
* deps: qs@6.9.7
* Fix handling of `__proto__` keys
* deps: raw-body@2.4.3
- deps: bytes@3.1.2

1.19.1 / 2021-12-10
===================

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@
"license": "MIT",
"repository": "expressjs/body-parser",
"dependencies": {
"bytes": "3.1.1",
"bytes": "3.1.2",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.2",
"http-errors": "1.8.1",
"iconv-lite": "0.4.24",
"on-finished": "~2.3.0",
"qs": "6.9.6",
"raw-body": "2.4.2",
"qs": "6.9.7",
"raw-body": "2.4.3",
"type-is": "~1.6.18"
},
"devDependencies": {
"eslint": "7.32.0",
"eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.1.0",
"methods": "1.1.2",
"mocha": "9.1.3",
"mocha": "9.2.0",
"nyc": "15.1.0",
"safe-buffer": "5.2.1",
"supertest": "6.1.6"
"supertest": "6.2.2"
},
"files": [
"lib/",
Expand Down
9 changes: 9 additions & 0 deletions test/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ describe('bodyParser.json()', function () {
test.expect(413, done)
})

it('should 413 when inflated body over limit', function (done) {
var server = createServer({ limit: '1kb' })
var test = request(server).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'application/json')
test.write(Buffer.from('1f8b080000000000000aab562a2e2952b252d21b05a360148c58a0540b0066f7ce1e0a040000', 'hex'))
test.expect(413, done)
})

it('should accept number of bytes', function (done) {
var buf = Buffer.alloc(1024, '.')
request(createServer({ limit: 1024 }))
Expand Down
9 changes: 9 additions & 0 deletions test/raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ describe('bodyParser.raw()', function () {
test.expect(413, done)
})

it('should 413 when inflated body over limit', function (done) {
var server = createServer({ limit: '1kb' })
var test = request(server).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'application/octet-stream')
test.write(Buffer.from('1f8b080000000000000ad3d31b05a360148c64000087e5a14704040000', 'hex'))
test.expect(413, done)
})

it('should accept number of bytes', function (done) {
var buf = Buffer.alloc(1028, '.')
var server = createServer({ limit: 1024 })
Expand Down
9 changes: 9 additions & 0 deletions test/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ describe('bodyParser.text()', function () {
test.expect(413, done)
})

it('should 413 when inflated body over limit', function (done) {
var server = createServer({ limit: '1kb' })
var test = request(server).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'text/plain')
test.write(Buffer.from('1f8b080000000000000ad3d31b05a360148c64000087e5a14704040000', 'hex'))
test.expect(413, done)
})

it('should accept number of bytes', function (done) {
var buf = Buffer.alloc(1028, '.')
request(createServer({ limit: 1024 }))
Expand Down
9 changes: 9 additions & 0 deletions test/urlencoded.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@ describe('bodyParser.urlencoded()', function () {
test.expect(413, done)
})

it('should 413 when inflated body over limit', function (done) {
var server = createServer({ limit: '1kb' })
var test = request(server).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'application/x-www-form-urlencoded')
test.write(Buffer.from('1f8b080000000000000a2b2e29b2d51b05a360148c580000a0351f9204040000', 'hex'))
test.expect(413, done)
})

it('should accept number of bytes', function (done) {
var buf = Buffer.alloc(1024, '.')
request(createServer({ limit: 1024 }))
Expand Down

0 comments on commit d6be2b3

Please sign in to comment.