Skip to content

Release 2.0 #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9eb206b
Default urlencoded extended option to false
dougwilson Sep 16, 2014
08d95a4
Use on-finished to determine when body read
dougwilson Sep 16, 2014
6cbc279
Remove req.body initialization to {}
dougwilson Sep 16, 2014
f26cd9d
Drop support for Node.js 0.8
dougwilson Dec 18, 2021
fbd9664
2.0.0-beta.1
dougwilson Dec 18, 2021
d6be2b3
Merge tag '1.19.2'
dougwilson Feb 19, 2022
3f5e93e
doc: fix req.body empty object note
dougwilson Feb 19, 2022
2fd44ac
Merge tag '1.20.2'
dougwilson Feb 22, 2023
5287a44
deps: raw-body@3.0.0-beta.1
dougwilson Feb 22, 2023
28192d6
deps: iconv-lite@0.5.2
dougwilson Feb 22, 2023
f8424b1
deps: debug@3.1.0
dougwilson Feb 22, 2023
42de1bf
build: remove conditional code coverage
dougwilson Feb 22, 2023
4d7b821
Remove deprecated bodyParser() combination middleware
dougwilson Feb 22, 2023
87e60af
tests: enable strict mode
dougwilson Feb 22, 2023
b53363c
docs: add missing history entry
dougwilson Feb 23, 2023
fccaf48
2.0.0-beta.2
dougwilson Feb 23, 2023
ddf9b75
feat!: remove node less than 18 from ci
wesleytodd Jul 22, 2024
7eb00cd
Also use the qs module for the simple parser (#387)
papandreou Jul 24, 2024
35b50b5
fix(deps): raw-body@^3.0.0 (#529)
wesleytodd Jul 25, 2024
6cea6bd
urlencoded: Support iso-8859-1, utf8 sentinel, and numeric entities (…
papandreou Jul 30, 2024
07ce14d
Added support for brotli ('br') content-encoding (#406)
danielgindi Aug 17, 2024
afd0f39
feat: add option to customize the depth with a default value of 32
UlisesGascon Sep 10, 2024
9232c77
Merge branch 'master' into 2.x
UlisesGascon Sep 10, 2024
a50ab74
2.0.0
UlisesGascon Sep 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use on-finished to determine when body read
  • Loading branch information
dougwilson committed Dec 16, 2021
commit 08d95a426fdbb30950ace39d1a60b85abfc100d5
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
===

* `urlencoded` parser now defaults `extended` to `false`
* Use `on-finished` to determine when body read

1.19.1 / 2021-12-10
===================
Expand Down
3 changes: 0 additions & 3 deletions lib/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ function read (req, res, next, parse, debug, options) {
var opts = options
var stream

// flag as parsed
req._body = true

// read options
var encoding = opts.encoding !== null
? opts.encoding
Expand Down
3 changes: 2 additions & 1 deletion lib/types/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var bytes = require('bytes')
var contentType = require('content-type')
var createError = require('http-errors')
var debug = require('debug')('body-parser:json')
var isFinished = require('on-finished').isFinished
var read = require('../read')
var typeis = require('type-is')

Expand Down Expand Up @@ -96,7 +97,7 @@ function json (options) {
}

return function jsonParser (req, res, next) {
if (req._body) {
if (isFinished(req)) {
debug('body already parsed')
next()
return
Expand Down
3 changes: 2 additions & 1 deletion lib/types/raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

var bytes = require('bytes')
var debug = require('debug')('body-parser:raw')
var isFinished = require('on-finished').isFinished
var read = require('../read')
var typeis = require('type-is')

Expand Down Expand Up @@ -53,7 +54,7 @@ function raw (options) {
}

return function rawParser (req, res, next) {
if (req._body) {
if (isFinished(req)) {
debug('body already parsed')
next()
return
Expand Down
3 changes: 2 additions & 1 deletion lib/types/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
var bytes = require('bytes')
var contentType = require('content-type')
var debug = require('debug')('body-parser:text')
var isFinished = require('on-finished').isFinished
var read = require('../read')
var typeis = require('type-is')

Expand Down Expand Up @@ -55,7 +56,7 @@ function text (options) {
}

return function textParser (req, res, next) {
if (req._body) {
if (isFinished(req)) {
debug('body already parsed')
next()
return
Expand Down
3 changes: 2 additions & 1 deletion lib/types/urlencoded.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var bytes = require('bytes')
var contentType = require('content-type')
var createError = require('http-errors')
var debug = require('debug')('body-parser:urlencoded')
var isFinished = require('on-finished').isFinished
var read = require('../read')
var typeis = require('type-is')

Expand Down Expand Up @@ -71,7 +72,7 @@ function urlencoded (options) {
}

return function urlencodedParser (req, res, next) {
if (req._body) {
if (isFinished(req)) {
debug('body already parsed')
next()
return
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy