Comparing version 5.0.3 to 6.0.0
@@ -56,3 +56,3 @@ 'use strict'; | ||
exports.Dispenser = internals.Dispenser = class extends Stream.Writable { | ||
exports.Dispenser = class extends Stream.Writable { | ||
@@ -81,6 +81,6 @@ constructor(options) { | ||
this._parts.on('needle', () => this._onPartEnd()); | ||
this._parts.on('haystack', (chunk) => this._onPart(chunk)); | ||
this._lines.on('needle', () => this._onLineEnd()); | ||
this._lines.on('haystack', (chunk) => this._onLine(chunk)); | ||
this._parts.on('needle', () => this.#onPartEnd()); | ||
this._parts.on('haystack', (chunk) => this.#onPart(chunk)); | ||
this._lines.on('needle', () => this.#onLineEnd()); | ||
this._lines.on('haystack', (chunk) => this.#onLine(chunk)); | ||
this.once('finish', () => this._parts.end()); | ||
@@ -99,6 +99,6 @@ this._parts.once('close', () => this._lines.end()); | ||
if (err) { | ||
return this._abort(err); | ||
return this.#abort(err); | ||
} | ||
this._emit('close'); | ||
this.#emit('close'); | ||
}; | ||
@@ -112,3 +112,3 @@ | ||
if (this._held) { | ||
this._emit('epilogue', this._held); | ||
this.#emit('epilogue', this._held); | ||
this._held = ''; | ||
@@ -119,10 +119,10 @@ } | ||
if (!this._held) { | ||
this._abort(Boom.badRequest('Missing end boundary')); | ||
this.#abort(Boom.badRequest('Missing end boundary')); | ||
} | ||
else if (this._held !== '--') { | ||
this._abort(Boom.badRequest('Only white space allowed after boundary at end')); | ||
this.#abort(Boom.badRequest('Only white space allowed after boundary at end')); | ||
} | ||
} | ||
else { | ||
this._abort(Boom.badRequest('Incomplete multipart payload')); | ||
this.#abort(Boom.badRequest('Incomplete multipart payload')); | ||
} | ||
@@ -166,3 +166,3 @@ | ||
_emit(...args) { | ||
#emit(...args) { | ||
@@ -176,9 +176,9 @@ if (this._error) { | ||
_abort(err) { | ||
#abort(err) { | ||
this._emit('error', err); | ||
this.#emit('error', err); | ||
this._error = err; | ||
} | ||
_onPartEnd() { | ||
#onPartEnd() { | ||
@@ -194,6 +194,6 @@ this._lines.flush(); | ||
return this._abort(Boom.badRequest('Preamble missing CRLF terminator')); | ||
return this.#abort(Boom.badRequest('Preamble missing CRLF terminator')); | ||
} | ||
this._emit('preamble', this._held.slice(0, -2)); | ||
this.#emit('preamble', this._held.slice(0, -2)); | ||
this._held = ''; | ||
@@ -212,3 +212,3 @@ } | ||
else if (this._name) { | ||
this._emit('field', this._name, this._held); | ||
this.#emit('field', this._name, this._held); | ||
this._name = ''; | ||
@@ -219,3 +219,3 @@ this._held = ''; | ||
_onPart(chunk) { | ||
#onPart(chunk) { | ||
@@ -238,3 +238,3 @@ if (this._state === internals.state.preamble) { | ||
_onLineEnd() { | ||
#onLineEnd() { | ||
@@ -254,3 +254,3 @@ // Boundary whitespace | ||
return this._abort(Boom.badRequest('Only white space allowed after boundary')); | ||
return this.#abort(Boom.badRequest('Only white space allowed after boundary')); | ||
} | ||
@@ -278,3 +278,3 @@ } | ||
if (!this._pendingHeader) { | ||
return this._abort(Boom.badRequest('Invalid header continuation without valid declaration on previous line')); | ||
return this.#abort(Boom.badRequest('Invalid header continuation without valid declaration on previous line')); | ||
} | ||
@@ -289,3 +289,3 @@ | ||
this._flushHeader(); | ||
this.#flushHeader(); | ||
this._pendingHeader = this._held; | ||
@@ -299,3 +299,3 @@ this._held = ''; | ||
this._flushHeader(); | ||
this.#flushHeader(); | ||
@@ -310,3 +310,3 @@ this._state = internals.state.payload; | ||
catch (err) { | ||
return this._abort(err); | ||
return this.#abort(err); | ||
} | ||
@@ -332,3 +332,3 @@ | ||
this._headers = {}; | ||
this._emit('part', stream); | ||
this.#emit('part', stream); | ||
} | ||
@@ -348,3 +348,3 @@ else { | ||
_onLine(chunk) { | ||
#onLine(chunk) { | ||
@@ -359,3 +359,3 @@ if (this._stream) { | ||
_flushHeader() { | ||
#flushHeader() { | ||
@@ -369,7 +369,7 @@ if (!this._pendingHeader) { | ||
if (sep === -1) { | ||
return this._abort(Boom.badRequest('Invalid header missing colon separator')); | ||
return this.#abort(Boom.badRequest('Invalid header missing colon separator')); | ||
} | ||
if (!sep) { | ||
return this._abort(Boom.badRequest('Invalid header missing field name')); | ||
return this.#abort(Boom.badRequest('Invalid header missing field name')); | ||
} | ||
@@ -379,3 +379,3 @@ | ||
if (name === '__proto__') { | ||
return this._abort(Boom.badRequest('Invalid header')); | ||
return this.#abort(Boom.badRequest('Invalid header')); | ||
} | ||
@@ -382,0 +382,0 @@ |
@@ -1,4 +0,5 @@ | ||
Copyright (c) 2014-2020, Sideway Inc, and project contributors | ||
Copyright (c) 2014, Walmart. | ||
Copyright (c) 2011-2013 Felix Geisendörfer, Andrew Kelley | ||
Copyright (c) 2014-2022, Project contributors | ||
Copyright (c) 2014-2020, Sideway Inc | ||
Copyright (c) 2014, Walmart. | ||
Copyright (c) 2011-2013 Felix Geisendörfer, Andrew Kelley | ||
All rights reserved. | ||
@@ -5,0 +6,0 @@ |
{ | ||
"name": "@hapi/pez", | ||
"description": "Multipart parser", | ||
"version": "5.0.3", | ||
"version": "6.0.0", | ||
"repository": "git://github.com/hapijs/pez", | ||
@@ -15,15 +15,21 @@ "main": "lib/index.js", | ||
], | ||
"eslintConfig": { | ||
"extends": [ | ||
"plugin:@hapi/module" | ||
] | ||
}, | ||
"dependencies": { | ||
"@hapi/b64": "5.x.x", | ||
"@hapi/boom": "9.x.x", | ||
"@hapi/content": "^5.0.2", | ||
"@hapi/hoek": "9.x.x", | ||
"@hapi/nigel": "4.x.x" | ||
"@hapi/b64": "^6.0.0", | ||
"@hapi/boom": "^10.0.0", | ||
"@hapi/content": "^6.0.0", | ||
"@hapi/hoek": "^10.0.0", | ||
"@hapi/nigel": "^5.0.0" | ||
}, | ||
"devDependencies": { | ||
"@hapi/code": "8.x.x", | ||
"@hapi/lab": "22.x.x", | ||
"@hapi/teamwork": "4.x.x", | ||
"@hapi/wreck": "17.x.x", | ||
"form-data": "3.x.x" | ||
"@hapi/code": "^9.0.0", | ||
"@hapi/eslint-plugin": "*", | ||
"@hapi/lab": "^25.0.1", | ||
"@hapi/teamwork": "^6.0.0", | ||
"@hapi/wreck": "^18.0.0", | ||
"form-data": "4.x.x" | ||
}, | ||
@@ -30,0 +36,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12969
6
1
+ Added@hapi/b64@6.0.1(transitive)
+ Added@hapi/boom@10.0.1(transitive)
+ Added@hapi/content@6.0.0(transitive)
+ Added@hapi/hoek@10.0.111.0.6(transitive)
+ Added@hapi/nigel@5.0.1(transitive)
+ Added@hapi/vise@5.0.1(transitive)
- Removed@hapi/b64@5.0.0(transitive)
- Removed@hapi/boom@9.1.4(transitive)
- Removed@hapi/content@5.0.2(transitive)
- Removed@hapi/hoek@9.3.0(transitive)
- Removed@hapi/nigel@4.0.2(transitive)
- Removed@hapi/vise@4.0.0(transitive)
Updated@hapi/b64@^6.0.0
Updated@hapi/boom@^10.0.0
Updated@hapi/content@^6.0.0
Updated@hapi/hoek@^10.0.0
Updated@hapi/nigel@^5.0.0