fix problem with Content-Length header

I found that content length is too short so the response body is simply trimmed. This is a quick hack that allows me to go forward with my app. Feel free to improve.