Comparing version 16.6.0 to 16.6.1
@@ -162,2 +162,20 @@ 'use strict'; | ||
this._listenRequest(); | ||
// Log request | ||
const about = { | ||
method: this.method, | ||
url: this.url.href, | ||
agent: this.raw.req.headers['user-agent'] | ||
}; | ||
this._log(['received'], about, now); // Must be last for object to be fully constructed | ||
}; | ||
Hoek.inherits(internals.Request, Podium); | ||
internals.Request.prototype._listenRequest = function () { | ||
this._onEnd = () => { | ||
@@ -197,17 +215,5 @@ | ||
this.raw.req.once('aborted', this._onAbort); | ||
// Log request | ||
const about = { | ||
method: this.method, | ||
url: this.url.href, | ||
agent: this.raw.req.headers['user-agent'] | ||
}; | ||
this._log(['received'], about, now); // Must be last for object to be fully constructed | ||
}; | ||
Hoek.inherits(internals.Request, Podium); | ||
internals.Request.prototype._setUrl = function (url, stripTrailingSlash) { | ||
@@ -331,3 +337,3 @@ | ||
if (!this.connection._extensions.onRequest.nodes) { | ||
return this._lifecycle(); | ||
return this._match(); | ||
} | ||
@@ -337,3 +343,3 @@ | ||
return this._lifecycle(err); | ||
return this._match(err); | ||
}); | ||
@@ -343,3 +349,3 @@ }; | ||
internals.Request.prototype._lifecycle = function (err) { | ||
internals.Request.prototype._match = function (err) { | ||
@@ -380,4 +386,31 @@ // Undecorate request | ||
// Setup timeout | ||
return this._lifecycle(); | ||
}; | ||
internals.Request.prototype._lifecycle = function () { | ||
this._setTimeouts(); | ||
const each = (func, next) => { | ||
if (this._isReplied || | ||
this._isBailed) { | ||
return next(Boom.internal('Already closed')); // Error is not used | ||
} | ||
if (typeof func !== 'function') { // Extension point | ||
return this._invoke(func, next); // next() called with response object which ends processing (treated like error) | ||
} | ||
return func(this, next); | ||
}; | ||
return Items.serial(this._route._cycle, each, (err) => this._reply(err)); | ||
}; | ||
internals.Request.prototype._setTimeouts = function () { | ||
if (this.raw.req.socket && | ||
@@ -404,21 +437,2 @@ this.route.settings.timeout.socket !== undefined) { | ||
} | ||
// Execute lifecycle steps | ||
const each = (func, next) => { | ||
if (this._isReplied || | ||
this._isBailed) { | ||
return next(Boom.internal('Already closed')); // Error is not used | ||
} | ||
if (typeof func !== 'function') { // Extension point | ||
return this._invoke(func, next); // next() called with response object which ends processing (treated like error) | ||
} | ||
return func(this, next); | ||
}; | ||
return Items.serial(this._route._cycle, each, (err) => this._reply(err)); | ||
}; | ||
@@ -433,3 +447,2 @@ | ||
const options = { postHandler: (event.type === 'onPostHandler' || event.type === 'onPreResponse') }; | ||
const finalize = (result, override) => { | ||
@@ -444,2 +457,3 @@ | ||
const options = { postHandler: (event.type === 'onPostHandler' || event.type === 'onPreResponse') }; | ||
const reply = this.server._replier.interface(this, ext.plugin.realm, options, finalize); | ||
@@ -446,0 +460,0 @@ const bind = (ext.bind || ext.plugin.realm.settings.bind); |
@@ -89,3 +89,4 @@ 'use strict'; | ||
for (let i = 0; i < err.details.length; ++i) { | ||
error.output.payload.validation.keys.push(Hoek.escapeHtml(err.details[i].path)); | ||
const path = err.details[i].path; | ||
error.output.payload.validation.keys.push(Hoek.escapeHtml(Array.isArray(path) ? path.join('.') : path)); | ||
} | ||
@@ -92,0 +93,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"homepage": "http://hapijs.com", | ||
"version": "16.6.0", | ||
"version": "16.6.1", | ||
"repository": { | ||
@@ -33,3 +33,3 @@ "type": "git", | ||
"items": "^2.1.1", | ||
"joi": "^10.6.0", | ||
"joi": "^11.1.0", | ||
"mimos": "^3.0.3", | ||
@@ -36,0 +36,0 @@ "podium": "^1.3.0", |
@@ -11,3 +11,3 @@ <img src="https://raw.github.com/hapijs/hapi/master/images/hapi.png" /> | ||
Development version: **16.5.x** ([release notes](https://github.com/hapijs/hapi/issues?labels=release+notes&page=1&state=closed)) | ||
Development version: **16.6.x** ([release notes](https://github.com/hapijs/hapi/issues?labels=release+notes&page=1&state=closed)) | ||
[![Build Status](https://secure.travis-ci.org/hapijs/hapi.svg?branch=master)](http://travis-ci.org/hapijs/hapi) | ||
@@ -14,0 +14,0 @@ |
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
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
185446
4522
+ Addedisemail@3.2.0(transitive)
+ Addedjoi@11.4.0(transitive)
+ Addedpunycode@2.3.1(transitive)
- Removedisemail@2.2.1(transitive)
- Removedjoi@10.6.0(transitive)
Updatedjoi@^11.1.0