Closed h6ah4i closed 7 years ago
Wow. I suspect this is a change in nodejs internals in latest versions. I don't know why that happens, the statusCode
property should be defined when calling response.writeHead()
method :S
Anyway, I have fixed this. Try upgrading rocky
to v0.4.15
:
$ npm update rocky --force
Thanks for reporting the issue.
Thanks for a quick response 😄
Hi. Thanks for the superb library, it's very handy and useful! However, I am just struggling the behavior of
useResponse()
callback now.What I want to do
I want to change the response body according to
statusCode
of upstream. However, theres.statusCode
is always 200 inuseResponse
callbacks. Is this intended behavior?Hack
I dug into the rocky library and found that the
headArgs
variable holds the original status code which I need. I tweaked thelib/middleware/response-body.js
like following;I am not sure whether this modification is good or bad, so I've not created a pull request yet :(
Thanks.