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

request.raw.res.end() method is called twice #2966

Closed
jbpionnier opened this issue Dec 7, 2015 · 2 comments
Closed

request.raw.res.end() method is called twice #2966

jbpionnier opened this issue Dec 7, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@jbpionnier
Copy link

@jbpionnier jbpionnier commented Dec 7, 2015

request.raw.res.end() method is called twice
https://nodejs.org/api/http.html#http_response_end_data_encoding_callback

I think the problem comes from here
https://github.com/hapijs/hapi/blob/master/lib/transmit.js#L295

I test with :

server.ext('onRequest', function (request, reply) {
  const res = request.raw.res
  const func = res.end

  res.end = function (data, encoding) {
    console.log('method is called twice')
    func.call(res, data, encoding)
  }

  reply.continue()
});
@Marsup
Copy link
Contributor

@Marsup Marsup commented Dec 7, 2015

If it's not aborted then what is it ?

@hueniverse hueniverse self-assigned this Dec 29, 2015
@hueniverse hueniverse added this to the 12.0.0 milestone Dec 29, 2015
@hueniverse hueniverse added the bug label Dec 29, 2015
@jbpionnier
Copy link
Author

@jbpionnier jbpionnier commented Jan 5, 2016

Thanks 😃

@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants