-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server onRequest handler no longer requires a socket in the request #9332
Conversation
Can one of the admins verify this patch? |
Figure I should note that I'd appreciate it if this can be backported through to whatever the next 5.0.x release will be when it's merged. |
@spalger Mind doing the review for this PR? |
@@ -48,7 +48,7 @@ export default function (kbnServer, server, config) { | |||
}); | |||
|
|||
server.ext('onRequest', function (req, reply) { | |||
if (req.raw.req.socket.encrypted) { | |||
if (!req.raw.req.socket || req.raw.req.socket.encrypted) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your description would make a great comment here, to explain the context:
// 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) {
jenkins, test this |
Per elastic#9302 A request sent through a HapiJS .inject() doesn't have a socket associated with the request, which causes a failure.
509f763
to
a5452f7
Compare
I've added a comment as requested, as well as rebased on to master to pull in the latest commits :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks @meganwalker-ibm
jenkins, test this |
Backports PR #9332 **Commit 1:** server onRequest handler no longer requires a socket in the request Per #9302 A request sent through a HapiJS .inject() doesn't have a socket associated with the request, which causes a failure. * Original sha: a5452f7 * Authored by Megan Walker <megan.walker@uk.ibm.com> on 2016-12-01T15:29:12Z
…9438) Backports PR #9332 **Commit 1:** server onRequest handler no longer requires a socket in the request Per #9302 A request sent through a HapiJS .inject() doesn't have a socket associated with the request, which causes a failure. * Original sha: a5452f7 * Authored by Megan Walker <megan.walker@uk.ibm.com> on 2016-12-01T15:29:12Z
Thanks for the PR @meganwalker-ibm ! |
…lastic#9332) Per elastic#9302 A request sent through a HapiJS .inject() doesn't have a socket associated with the request, which causes a failure.
Per #9302 A request sent through a HapiJS .inject() doesn't have
a socket associated with the request, which causes a failure.
NB: I haven't included new tests with this, as I can't workout how best to test it without adding two additional routes to src/server/http/index.js which seems incredibly heavy weight. I'm open to suggestions on how best to add a test to this though.