Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
In Node, piping a post results in garbage added #130
I have a server running in Node that responds to HTTP POSTs.
The message is transmitted to the proper server, it handles it properly, responds as it's supposed to, and PagePark transmits the response, with one problem. It adds extra characters before and after the response.
Here's a gist containing the actual response.
The characters added at the beginning of the response: 1f7
And at the end: 0
I have to admit I don't understand what the piping is doing, and I haven't found a way to debug this. So I'm looking for either possible answers, or possible ways to debug.
@PeterJudge-PSC -- thank you. That was exactly right.
I added a Content-Length header to the response from the server, and now it all works well.
Interesting to note -- It's an XML-RPC handler, and the XML-RPC spec clearly says the response must include a content-length header. Also it was a bug in my implementation of the client side that it didn't understand chunks. And my discomfort with pipes led me to believe the problem was probably there. It wasn't. ;-)