Adding safe check for undefined body, it breaks in node v0.10.5 but not in previous versions. This should be related to the changes in the stream API in recent node versions ( > 0.10.x )