Skip to content
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

Merged
merged 1 commit into from
Dec 10, 2016

Conversation

meganwalker-ibm
Copy link
Contributor

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.

@elasticmachine
Copy link
Contributor

Can one of the admins verify this patch?

@meganwalker-ibm
Copy link
Contributor Author

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.

@meganwalker-ibm
Copy link
Contributor Author

@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) {
Copy link
Contributor

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) {

@cjcenizal
Copy link
Contributor

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.
@meganwalker-ibm
Copy link
Contributor Author

I've added a comment as requested, as well as rebased on to master to pull in the latest commits :)

Copy link
Contributor

@spalger spalger left a 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

@cjcenizal
Copy link
Contributor

jenkins, test this

@cjcenizal cjcenizal merged commit 10c2136 into elastic:master Dec 10, 2016
elastic-jasper added a commit that referenced this pull request Dec 10, 2016
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
cjcenizal pushed a commit that referenced this pull request Dec 10, 2016
…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
@cjcenizal cjcenizal added the bug Fixes for quality problems that affect the customer experience label Dec 10, 2016
@cjcenizal
Copy link
Contributor

Thanks for the PR @meganwalker-ibm !

@epixa epixa added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Dec 12, 2016
danwhitacre pushed a commit to danwhitacre/kibana that referenced this pull request Feb 6, 2017
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v5.2.0 v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants