We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e15bdfd commit 3694fbcCopy full SHA for 3694fbc
1 file changed
lib/types/urlencoded.js
@@ -39,13 +39,7 @@ function urlencoded (options) {
39
}
40
41
// create the appropriate query parser
42
- var queryparse = createQueryParser(options)
43
-
44
- function parse (body, encoding) {
45
- return body.length
46
- ? queryparse(body, encoding)
47
- : {}
48
- }
+ const parse = createQueryParser(options)
49
50
const readOptions = {
51
...normalizedOptions,
@@ -86,7 +80,9 @@ function createQueryParser (options) {
86
80
parameterLimit = parameterLimit | 0
87
81
88
82
89
- return function queryparse (body, encoding) {
83
+ return function parse (body, encoding) {
84
+ if (!body.length) return {}
85
+
90
var paramCount = parameterCount(body, parameterLimit)
91
92
if (paramCount === undefined) {
0 commit comments