Skip to content

Commit

Permalink
server onRequest handler no longer requires a socket in the request
Browse files Browse the repository at this point in the history
Per #9302 A request sent through a HapiJS .inject() doesn't have
a socket associated with the request, which causes a failure.
  • Loading branch information
meganwalker-ibm committed Dec 9, 2016
1 parent 6e819c1 commit a5452f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/server/http/setup_connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit a5452f7

Please sign in to comment.