server onRequest handler no longer requires a socket in the request (#9332)

Per #9302 A request sent through a HapiJS .inject() doesn't have
a socket associated with the request, which causes a failure.
This commit is contained in:
Megan Walker 2016-12-10 01:00:54 +00:00 committed by CJ Cenizal
parent b20f996601
commit 10c2136010

View file

@ -48,7 +48,9 @@ export default function (kbnServer, server, config) {
});
server.ext('onRequest', function (req, reply) {
if (req.raw.req.socket.encrypted) {
// A request sent through a HapiJS .inject() doesn't have a socket associated with the request
// which causes a failure.
if (!req.raw.req.socket || req.raw.req.socket.encrypted) {
reply.continue();
} else {
reply.redirect(formatUrl({